@@ -960,7 +960,7 @@ public void trackDispatchEventThrowsException() throws Exception {
960960 //======== live variable getters tests ========//
961961
962962 /**
963- * Verify that {@link Optimizely#getVariableString(String, boolean, String )} returns null and logs properly when
963+ * Verify that {@link Optimizely#getVariableString(String, String, boolean )} returns null and logs properly when
964964 * an invalid live variable key is provided and the {@link NoOpErrorHandler} is used.
965965 */
966966 @ Test
@@ -973,11 +973,11 @@ public void getVariableInvalidVariableKeyNoOpErrorHandler() throws Exception {
973973 .build ();
974974
975975 logbackVerifier .expectMessage (Level .ERROR , "Live variable \" invalid_key\" is not in the datafile." );
976- assertNull (optimizely .getVariableString ("invalid_key" , false , "userId" ));
976+ assertNull (optimizely .getVariableString ("invalid_key" , "userId" , false ));
977977 }
978978
979979 /**
980- * Verify that {@link Optimizely#getVariableString(String, boolean, String )} returns throws an
980+ * Verify that {@link Optimizely#getVariableString(String, String, boolean )} returns throws an
981981 * {@link UnknownLiveVariableException} when an invalid live variable key is provided and the
982982 * {@link RaiseExceptionErrorHandler} is used.
983983 */
@@ -993,11 +993,11 @@ public void getVariableInvalidVariableKeyRaiseExceptionErrorHandler() throws Exc
993993 .withErrorHandler (new RaiseExceptionErrorHandler ())
994994 .build ();
995995
996- optimizely .getVariableString ("invalid_key" , false , "userId" );
996+ optimizely .getVariableString ("invalid_key" , "userId" , false );
997997 }
998998
999999 /**
1000- * Verify that {@link Optimizely#getVariableString(String, boolean, String, Map)} returns a string live variable
1000+ * Verify that {@link Optimizely#getVariableString(String, String, Map, boolean )} returns a string live variable
10011001 * value when an proper variable key is provided and dispatches an impression when activateExperiment is true.
10021002 */
10031003 @ Test
@@ -1017,14 +1017,14 @@ public void getVariableStringActivateExperimentTrue() throws Exception {
10171017 .withErrorHandler (new RaiseExceptionErrorHandler ())
10181018 .build ();
10191019
1020- assertThat (optimizely .getVariableString ("string_variable" , true , "userId" ,
1021- Collections .singletonMap ("browser_type" , "chrome" )),
1020+ assertThat (optimizely .getVariableString ("string_variable" , "userId" ,
1021+ Collections .singletonMap ("browser_type" , "chrome" ), true ),
10221022 is ("string_var_vtag1" ));
10231023 verify (mockEventHandler ).dispatchEvent (any (LogEvent .class ));
10241024 }
10251025
10261026 /**
1027- * Verify that {@link Optimizely#getVariableString(String, boolean, String, Map)} returns a string live variable
1027+ * Verify that {@link Optimizely#getVariableString(String, String, Map, boolean )} returns a string live variable
10281028 * value when an proper variable key is provided and doesn't dispatch an impression when activateExperiment is
10291029 * false.
10301030 */
@@ -1045,14 +1045,14 @@ public void getVariableStringActivateExperimentFalse() throws Exception {
10451045 .withErrorHandler (new RaiseExceptionErrorHandler ())
10461046 .build ();
10471047
1048- assertThat (optimizely .getVariableString ("string_variable" , false , "userId" ,
1049- Collections .singletonMap ("browser_type" , "chrome" )),
1048+ assertThat (optimizely .getVariableString ("string_variable" , "userId" ,
1049+ Collections .singletonMap ("browser_type" , "chrome" ), false ),
10501050 is ("string_var_vtag1" ));
10511051 verify (mockEventHandler , never ()).dispatchEvent (any (LogEvent .class ));
10521052 }
10531053
10541054 /**
1055- * Verify that {@link Optimizely#getVariableString(String, boolean, String )} returns the default value of
1055+ * Verify that {@link Optimizely#getVariableString(String, String, boolean )} returns the default value of
10561056 * a live variable when no experiments are using the live variable.
10571057 */
10581058 @ Test
@@ -1065,11 +1065,11 @@ public void getVariableStringReturnsDefaultValueNoExperimentsUsingLiveVariable()
10651065 .build ();
10661066
10671067 logbackVerifier .expectMessage (Level .WARN , "No experiment is using variable \" unused_string_variable\" ." );
1068- assertThat (optimizely .getVariableString ("unused_string_variable" , true , "userId" ), is ("unused_variable" ));
1068+ assertThat (optimizely .getVariableString ("unused_string_variable" , "userId" , true ), is ("unused_variable" ));
10691069 }
10701070
10711071 /**
1072- * Verify that {@link Optimizely#getVariableString(String, boolean, String, Map)} returns the default value when
1072+ * Verify that {@link Optimizely#getVariableString(String, String, Map, boolean )} returns the default value when
10731073 * a user isn't bucketed into a variation in the experiment.
10741074 */
10751075 @ Test
@@ -1086,13 +1086,13 @@ public void getVariableStringReturnsDefaultValueUserNotInVariation() throws Exce
10861086 .withBucketing (mockBucketer )
10871087 .build ();
10881088
1089- assertThat (optimizely .getVariableString ("string_variable" , true , "userId" ,
1090- Collections .singletonMap ("browser_type" , "chrome" )),
1089+ assertThat (optimizely .getVariableString ("string_variable" , "userId" ,
1090+ Collections .singletonMap ("browser_type" , "chrome" ), true ),
10911091 is ("string_live_variable" ));
10921092 }
10931093
10941094 /**
1095- * Verify that {@link Optimizely#getVariableBoolean(String, boolean, String, Map)} returns a boolean live variable
1095+ * Verify that {@link Optimizely#getVariableBoolean(String, String, Map, boolean )} returns a boolean live variable
10961096 * value when an proper variable key is provided and dispatches an impression when activateExperiment is true.
10971097 */
10981098 @ Test
@@ -1111,12 +1111,12 @@ public void getVariableBoolean() throws Exception {
11111111 .withBucketing (mockBucketer )
11121112 .build ();
11131113
1114- assertTrue (optimizely .getVariableBoolean ("etag1_variable" , true , "userId" ,
1115- Collections .singletonMap ("browser_type" , "chrome" )));
1114+ assertTrue (optimizely .getVariableBoolean ("etag1_variable" , "userId" ,
1115+ Collections .singletonMap ("browser_type" , "chrome" ), true ));
11161116 }
11171117
11181118 /**
1119- * Verify that {@link Optimizely#getVariableFloat(String, boolean, String, Map)} returns a float live variable
1119+ * Verify that {@link Optimizely#getVariableFloat(String, String, Map, boolean )} returns a float live variable
11201120 * value when an proper variable key is provided and dispatches an impression when activateExperiment is true.
11211121 */
11221122 @ Test
@@ -1135,14 +1135,14 @@ public void getVariableFloat() throws Exception {
11351135 .withBucketing (mockBucketer )
11361136 .build ();
11371137
1138- assertThat (optimizely .getVariableFloat ("float_variable" , true , "userId" ,
1139- Collections .singletonMap ("browser_type" , "chrome" )),
1138+ assertThat (optimizely .getVariableFloat ("float_variable" , "userId" ,
1139+ Collections .singletonMap ("browser_type" , "chrome" ), true ),
11401140 is (5.3f ));
11411141 verify (mockEventHandler ).dispatchEvent (any (LogEvent .class ));
11421142 }
11431143
11441144 /**
1145- * Verify that {@link Optimizely#getVariableInteger(String, boolean, String, Map)} returns a integer live variable
1145+ * Verify that {@link Optimizely#getVariableInteger(String, String, Map, boolean )} returns a integer live variable
11461146 * value when an proper variable key is provided and dispatches an impression when activateExperiment is true.
11471147 */
11481148 @ Test
@@ -1161,8 +1161,8 @@ public void getVariableInteger() throws Exception {
11611161 .withBucketing (mockBucketer )
11621162 .build ();
11631163
1164- assertThat (optimizely .getVariableInteger ("integer_variable" , true , "userId" ,
1165- Collections .singletonMap ("browser_type" , "chrome" )),
1164+ assertThat (optimizely .getVariableInteger ("integer_variable" , "userId" ,
1165+ Collections .singletonMap ("browser_type" , "chrome" ), true ),
11661166 is (10 ));
11671167 verify (mockEventHandler ).dispatchEvent (any (LogEvent .class ));
11681168 }
@@ -1504,7 +1504,7 @@ public void addNotificationListener() throws Exception {
15041504
15051505 // Check if listener is notified when live variable is accessed
15061506 boolean activateExperiment = true ;
1507- optimizely .getVariableString ("string_variable" , activateExperiment , userId , attributes );
1507+ optimizely .getVariableString ("string_variable" , userId , attributes , activateExperiment );
15081508 verify (listener , times (2 ))
15091509 .onExperimentActivated (activatedExperiment , userId , attributes , actualVariation );
15101510 }
@@ -1558,7 +1558,7 @@ public void removeNotificationListener() throws Exception {
15581558
15591559 // Check if listener is notified after a live variable is accessed
15601560 boolean activateExperiment = true ;
1561- optimizely .getVariableString ("string_variable" , activateExperiment , userId , attributes );
1561+ optimizely .getVariableString ("string_variable" , userId , attributes , activateExperiment );
15621562 verify (listener , never ())
15631563 .onExperimentActivated (activatedExperiment , userId , attributes , actualVariation );
15641564 }
@@ -1611,7 +1611,7 @@ public void clearNotificationListeners() throws Exception {
16111611
16121612 // Check if listener is notified after a live variable is accessed
16131613 boolean activateExperiment = true ;
1614- optimizely .getVariableString ("string_variable" , activateExperiment , userId , attributes );
1614+ optimizely .getVariableString ("string_variable" , userId , attributes , activateExperiment );
16151615 verify (listener , never ())
16161616 .onExperimentActivated (activatedExperiment , userId , attributes , actualVariation );
16171617 }
0 commit comments