1
1
/****************************************************************************
2
- * Copyright 2017-2022 Optimizely, Inc. and contributors *
2
+ * Copyright 2017-2022,2024 Optimizely, Inc. and contributors *
3
3
* *
4
4
* Licensed under the Apache License, Version 2.0 (the "License"); *
5
5
* you may not use this file except in compliance with the License. *
@@ -379,7 +379,7 @@ describe('lib/core/decision_service', function() {
379
379
) ;
380
380
assert . strictEqual (
381
381
buildLogMessageFromArgs ( mockLogger . log . args [ 4 ] ) ,
382
- 'DECISION_SERVICE: Saved variation "control" of experiment "testExperiment" for user "decision_service_user".'
382
+ 'DECISION_SERVICE: Saved user profile for user "decision_service_user".'
383
383
) ;
384
384
} ) ;
385
385
@@ -392,6 +392,7 @@ describe('lib/core/decision_service', function() {
392
392
optimizely : { } ,
393
393
userId : 'decision_service_user' ,
394
394
} ) ;
395
+
395
396
assert . strictEqual (
396
397
'control' ,
397
398
decisionServiceInstance . getVariation ( configObj , experiment , user ) . result
@@ -400,11 +401,11 @@ describe('lib/core/decision_service', function() {
400
401
sinon . assert . calledOnce ( bucketerStub ) ; // should still go through with bucketing
401
402
assert . strictEqual (
402
403
buildLogMessageFromArgs ( mockLogger . log . args [ 0 ] ) ,
403
- 'DECISION_SERVICE: User decision_service_user is not in the forced variation map .'
404
+ 'DECISION_SERVICE: Error while looking up user profile for user ID "decision_service_user": I am an error .'
404
405
) ;
405
406
assert . strictEqual (
406
407
buildLogMessageFromArgs ( mockLogger . log . args [ 1 ] ) ,
407
- 'DECISION_SERVICE: Error while looking up user profile for user ID "decision_service_user": I am an error .'
408
+ 'DECISION_SERVICE: User decision_service_user is not in the forced variation map .'
408
409
) ;
409
410
} ) ;
410
411
@@ -1277,7 +1278,7 @@ describe('lib/core/decision_service', function() {
1277
1278
reasons : [ ] ,
1278
1279
} ;
1279
1280
experiment = configObj . experimentIdMap [ '594098' ] ;
1280
- getVariationStub = sandbox . stub ( decisionServiceInstance , 'getVariation ' ) ;
1281
+ getVariationStub = sandbox . stub ( decisionServiceInstance , 'resolveVariation ' ) ;
1281
1282
getVariationStub . returns ( fakeDecisionResponse ) ;
1282
1283
getVariationStub . withArgs ( configObj , experiment , user ) . returns ( fakeDecisionResponseWithArgs ) ;
1283
1284
} ) ;
@@ -1493,12 +1494,11 @@ describe('lib/core/decision_service', function() {
1493
1494
decisionSource : DECISION_SOURCES . FEATURE_TEST ,
1494
1495
} ;
1495
1496
assert . deepEqual ( decision , expectedDecision ) ;
1496
- sinon . assert . calledWithExactly (
1497
+ sinon . assert . calledWith (
1497
1498
getVariationStub ,
1498
1499
configObj ,
1499
1500
experiment ,
1500
1501
user ,
1501
- { }
1502
1502
) ;
1503
1503
} ) ;
1504
1504
} ) ;
@@ -1511,7 +1511,7 @@ describe('lib/core/decision_service', function() {
1511
1511
optimizely : { } ,
1512
1512
userId : 'user1' ,
1513
1513
} ) ;
1514
- getVariationStub = sandbox . stub ( decisionServiceInstance , 'getVariation ' ) ;
1514
+ getVariationStub = sandbox . stub ( decisionServiceInstance , 'resolveVariation ' ) ;
1515
1515
getVariationStub . returns ( fakeDecisionResponse ) ;
1516
1516
} ) ;
1517
1517
@@ -1550,7 +1550,7 @@ describe('lib/core/decision_service', function() {
1550
1550
result : 'var' ,
1551
1551
reasons : [ ] ,
1552
1552
} ;
1553
- getVariationStub = sandbox . stub ( decisionServiceInstance , 'getVariation ' ) ;
1553
+ getVariationStub = sandbox . stub ( decisionServiceInstance , 'resolveVariation ' ) ;
1554
1554
getVariationStub . returns ( fakeDecisionResponseWithArgs ) ;
1555
1555
getVariationStub . withArgs ( configObj , 'exp_with_group' , user ) . returns ( fakeDecisionResponseWithArgs ) ;
1556
1556
} ) ;
@@ -1607,7 +1607,7 @@ describe('lib/core/decision_service', function() {
1607
1607
optimizely : { } ,
1608
1608
userId : 'user1' ,
1609
1609
} ) ;
1610
- getVariationStub = sandbox . stub ( decisionServiceInstance , 'getVariation ' ) ;
1610
+ getVariationStub = sandbox . stub ( decisionServiceInstance , 'resolveVariation ' ) ;
1611
1611
getVariationStub . returns ( fakeDecisionResponse ) ;
1612
1612
} ) ;
1613
1613
0 commit comments