@@ -62,22 +62,6 @@ public class OptimizelyBuilderTest {
6262
6363 @ Mock private ErrorHandler mockErrorHandler ;
6464
65- @ Test (expected = ConfigParseException .class )
66- @ SuppressFBWarnings (value ="NP_NONNULL_PARAM_VIOLATION" , justification ="Testing nullness contract violation" )
67- public void withNullConfig () throws Exception {
68- Optimizely .builder (null , mockEventHandler ).build ();
69- }
70-
71- @ Test (expected = ConfigParseException .class )
72- public void withEmptyConfig () throws Exception {
73- Optimizely .builder ("" , mockEventHandler ).build ();
74- }
75-
76- @ Test (expected = ConfigParseException .class )
77- public void withInvalidConfig () throws Exception {
78- Optimizely .builder ("malformed json" , mockEventHandler ).build ();
79- }
80-
8165 @ Test
8266 public void withEventHandler () throws Exception {
8367 Optimizely optimizelyClient = Optimizely .builder (validConfigJsonV2 (), mockEventHandler )
@@ -180,6 +164,19 @@ public void withCustomClientVersion() throws Exception {
180164 assertThat (((EventBuilderV2 )optimizelyClient .eventBuilder ).clientVersion , is ("0.0.0" ));
181165 }
182166
167+ @ SuppressFBWarnings (value ="NP_NONNULL_PARAM_VIOLATION" , justification ="Testing nullness contract violation" )
168+ @ Test
169+ public void builderThrowsConfigParseExceptionForNullDatafile () throws Exception {
170+ thrown .expect (ConfigParseException .class );
171+ Optimizely .builder (null , mockEventHandler ).build ();
172+ }
173+
174+ @ Test
175+ public void builderThrowsConfigParseExceptionForEmptyDatafile () throws Exception {
176+ thrown .expect (ConfigParseException .class );
177+ Optimizely .builder ("" , mockEventHandler ).build ();
178+ }
179+
183180 @ Test
184181 public void builderThrowsConfigParseExceptionForInvalidDatafile () throws Exception {
185182 thrown .expect (ConfigParseException .class );
0 commit comments