@@ -82,11 +82,13 @@ public void optimizelyUserContext_withAttributes() {
82
82
83
83
@ Test
84
84
public void optimizelyUserContext_noAttributes () {
85
- OptimizelyUserContext user = new OptimizelyUserContext (optimizely , userId );
85
+ OptimizelyUserContext user_1 = new OptimizelyUserContext (optimizely , userId );
86
+ OptimizelyUserContext user_2 = new OptimizelyUserContext (optimizely , userId );
86
87
87
- assertEquals (user .getOptimizely (), optimizely );
88
- assertEquals (user .getUserId (), userId );
89
- assertTrue (user .getAttributes ().isEmpty ());
88
+ assertEquals (user_1 .getOptimizely (), optimizely );
89
+ assertEquals (user_1 .getUserId (), userId );
90
+ assertTrue (user_1 .getAttributes ().isEmpty ());
91
+ assertEquals (user_1 .hashCode (), user_2 .hashCode ());
90
92
}
91
93
92
94
@ Test
@@ -1263,21 +1265,6 @@ public void setForcedDecisionWithoutRuleKeyTest() {
1263
1265
}
1264
1266
1265
1267
1266
- @ Test
1267
- public void setForcedDecisionWithoutRuleKeyTestSdkNotReady () {
1268
- String flagKey = "55555" ;
1269
- String variationKey = "33333" ;
1270
- Optimizely optimizely = new Optimizely .Builder ().build ();
1271
- OptimizelyUserContext optimizelyUserContext = new OptimizelyUserContext (
1272
- optimizely ,
1273
- userId ,
1274
- Collections .emptyMap ());
1275
-
1276
- OptimizelyDecisionContext optimizelyDecisionContext = new OptimizelyDecisionContext (flagKey , null );
1277
- OptimizelyForcedDecision optimizelyForcedDecision = new OptimizelyForcedDecision (variationKey );
1278
- assertFalse (optimizelyUserContext .setForcedDecision (optimizelyDecisionContext , optimizelyForcedDecision ));
1279
- }
1280
-
1281
1268
@ Test
1282
1269
public void getForcedVariationWithRuleKey () {
1283
1270
String flagKey = "55555" ;
@@ -1330,22 +1317,6 @@ public void getForcedVariationWithoutRuleKey() {
1330
1317
assertEquals (variationKey , optimizelyUserContext .getForcedDecision (optimizelyDecisionContext ).getVariationKey ());
1331
1318
}
1332
1319
1333
- @ Test
1334
- public void getForcedVariationWithoutRuleKeySdkNotReady () {
1335
- String flagKey = "55555" ;
1336
- String variationKey = "33333" ;
1337
- Optimizely optimizely = new Optimizely .Builder ().build ();
1338
- OptimizelyUserContext optimizelyUserContext = new OptimizelyUserContext (
1339
- optimizely ,
1340
- userId ,
1341
- Collections .emptyMap ());
1342
-
1343
- OptimizelyDecisionContext optimizelyDecisionContext = new OptimizelyDecisionContext (flagKey , null );
1344
- OptimizelyForcedDecision optimizelyForcedDecision = new OptimizelyForcedDecision (variationKey );
1345
-
1346
- optimizelyUserContext .setForcedDecision (optimizelyDecisionContext , optimizelyForcedDecision );
1347
- assertNull (optimizelyUserContext .getForcedDecision (optimizelyDecisionContext ));
1348
- }
1349
1320
1350
1321
@ Test
1351
1322
public void failedGetForcedDecisionWithoutRuleKey () {
@@ -1434,22 +1405,6 @@ public void removeForcedDecisionWithIncorrectFlagKey() {
1434
1405
assertFalse (optimizelyUserContext .removeForcedDecision (incorrectOptimizelyDecisionContext ));
1435
1406
}
1436
1407
1437
- @ Test
1438
- public void removeForcedDecisionWithoutRuleKeySdkNotReady () {
1439
- String flagKey = "flag2" ;
1440
- String variationKey = "33333" ;
1441
- Optimizely optimizely = new Optimizely .Builder ().build ();
1442
- OptimizelyUserContext optimizelyUserContext = new OptimizelyUserContext (
1443
- optimizely ,
1444
- userId ,
1445
- Collections .emptyMap ());
1446
-
1447
- OptimizelyDecisionContext optimizelyDecisionContext = new OptimizelyDecisionContext (flagKey , null );
1448
- OptimizelyForcedDecision optimizelyForcedDecision = new OptimizelyForcedDecision (variationKey );
1449
-
1450
- optimizelyUserContext .setForcedDecision (optimizelyDecisionContext , optimizelyForcedDecision );
1451
- assertFalse (optimizelyUserContext .removeForcedDecision (optimizelyDecisionContext ));
1452
- }
1453
1408
1454
1409
@ Test
1455
1410
public void removeForcedDecisionWithIncorrectFlagKeyButSimilarRuleKey () {
@@ -1487,23 +1442,6 @@ public void removeAllForcedDecisions() {
1487
1442
assertTrue (optimizelyUserContext .removeAllForcedDecisions ());
1488
1443
}
1489
1444
1490
- @ Test
1491
- public void removeAllForcedDecisionsSdkNotReady () {
1492
- String flagKey = "55555" ;
1493
- String ruleKey = "77777" ;
1494
- String variationKey = "33333" ;
1495
- Optimizely optimizely = new Optimizely .Builder ().build ();
1496
- OptimizelyUserContext optimizelyUserContext = new OptimizelyUserContext (
1497
- optimizely ,
1498
- userId ,
1499
- Collections .emptyMap ());
1500
-
1501
- OptimizelyDecisionContext optimizelyDecisionContext = new OptimizelyDecisionContext (flagKey , ruleKey );
1502
- OptimizelyForcedDecision optimizelyForcedDecision = new OptimizelyForcedDecision (variationKey );
1503
-
1504
- optimizelyUserContext .setForcedDecision (optimizelyDecisionContext , optimizelyForcedDecision );
1505
- assertFalse (optimizelyUserContext .removeAllForcedDecisions ());
1506
- }
1507
1445
1508
1446
@ Test
1509
1447
public void findValidatedForcedDecisionWithRuleKey () {
0 commit comments