22
33import static org .junit .Assert .assertEquals ;
44import static org .junit .Assert .assertNotNull ;
5+ import static org .junit .Assert .assertTrue ;
56
67import android .content .Context ;
78import android .util .Log ;
@@ -98,4 +99,30 @@ public void onCompletion(SyncStack syncStack, Error error) {
9899 });
99100 assertNotNull (stack .syncParams );
100101 }
102+
103+ @ Test
104+ public void testEarlyAccess () throws Exception {
105+ Context ctx = ApplicationProvider .getApplicationContext ();
106+ Config config = new Config ();
107+ String [] earlyAccess = {"Taxonomy" };
108+ config .earlyAccess (earlyAccess );
109+ stack = Contentstack .stack (ctx , apiKey , deliveryToken , environment , config );
110+ assertEquals (earlyAccess [0 ], config .earlyAccess [0 ]);
111+ assertNotNull (stack .localHeader .containsKey ("x-header-ea" ));
112+ assertEquals ("Taxonomy" , stack .localHeader .get ("x-header-ea" ));
113+ }
114+
115+ @ Test
116+ public void testConfigEarlyAccessMultipleFeature () throws Exception {
117+ Context ctx = ApplicationProvider .getApplicationContext ();
118+ Config config = new Config ();
119+ String [] earlyAccess = {"Taxonomy" , "Teams" , "Terms" , "LivePreview" };
120+ config .earlyAccess (earlyAccess );
121+ stack = Contentstack .stack (ctx , apiKey , deliveryToken , environment , config );
122+ assertEquals (4 , stack .localHeader .keySet ().size ());
123+ assertEquals (earlyAccess [1 ], config .earlyAccess [1 ]);
124+ assertTrue (stack .localHeader .containsKey ("x-header-ea" ));
125+ assertEquals ("Taxonomy,Teams,Terms,LivePreview" , stack .localHeader .get ("x-header-ea" ));
126+ }
127+
101128}
0 commit comments