@@ -449,10 +449,10 @@ public void bucketUserNotInOverlappingGroupExperiment() throws Exception {
449
449
* Verify that {@link Bucketer#bucket(Experiment,String)} saves a variation of an experiment for a user
450
450
* when a {@link UserProfile} is present.
451
451
*/
452
- @ Test public void bucketUserSaveActivationWithUserExperimentRecord () throws Exception {
452
+ @ Test public void bucketUserSaveActivationWithUserProfile () throws Exception {
453
453
final AtomicInteger bucketValue = new AtomicInteger ();
454
454
UserProfile userProfile = mock (UserProfile .class );
455
- Bucketer algorithm = mockUserExperimentRecordAlgorithm (bucketValue , userProfile );
455
+ Bucketer algorithm = mockUserProfileAlgorithm (bucketValue , userProfile );
456
456
bucketValue .set (3000 );
457
457
458
458
ProjectConfig projectConfig = validProjectConfigV2 ();
@@ -474,10 +474,10 @@ public void bucketUserNotInOverlappingGroupExperiment() throws Exception {
474
474
* Verify that {@link Bucketer#bucket(Experiment,String)} logs correctly
475
475
* when a {@link UserProfile} is present and fails to save an activation.
476
476
*/
477
- @ Test public void bucketUserSaveActivationFailWithUserExperimentRecord () throws Exception {
477
+ @ Test public void bucketUserSaveActivationFailWithUserProfile () throws Exception {
478
478
final AtomicInteger bucketValue = new AtomicInteger ();
479
479
UserProfile userProfile = mock (UserProfile .class );
480
- Bucketer algorithm = mockUserExperimentRecordAlgorithm (bucketValue , userProfile );
480
+ Bucketer algorithm = mockUserProfileAlgorithm (bucketValue , userProfile );
481
481
bucketValue .set (3000 );
482
482
483
483
ProjectConfig projectConfig = validProjectConfigV2 ();
@@ -499,10 +499,10 @@ public void bucketUserNotInOverlappingGroupExperiment() throws Exception {
499
499
* Verify that {@link Bucketer#bucket(Experiment,String)} returns a variation that is
500
500
* stored in the provided {@link UserProfile}.
501
501
*/
502
- @ Test public void bucketUserRestoreActivationWithUserExperimentRecord () throws Exception {
502
+ @ Test public void bucketUserRestoreActivationWithUserProfile () throws Exception {
503
503
final AtomicInteger bucketValue = new AtomicInteger ();
504
504
UserProfile userProfile = mock (UserProfile .class );
505
- Bucketer algorithm = mockUserExperimentRecordAlgorithm (bucketValue , userProfile );
505
+ Bucketer algorithm = mockUserProfileAlgorithm (bucketValue , userProfile );
506
506
bucketValue .set (3000 );
507
507
508
508
ProjectConfig projectConfig = validProjectConfigV2 ();
@@ -516,7 +516,7 @@ public void bucketUserNotInOverlappingGroupExperiment() throws Exception {
516
516
517
517
logbackVerifier .expectMessage (Level .INFO ,
518
518
"Returning previously activated variation \" e2_vtag1\" of experiment \" group_etag2\" "
519
- + " for user \" blah\" from user experiment record ." );
519
+ + " for user \" blah\" from user profile ." );
520
520
521
521
verify (userProfile ).lookup ("blah" , groupExperiment .getKey ());
522
522
}
@@ -525,10 +525,10 @@ public void bucketUserNotInOverlappingGroupExperiment() throws Exception {
525
525
* Verify {@link Bucketer#bucket(Experiment,String)} handles a present {@link UserProfile}
526
526
* returning null when looking up a variation.
527
527
*/
528
- @ Test public void bucketUserRestoreActivationNullWithUserExperimentRecord () throws Exception {
528
+ @ Test public void bucketUserRestoreActivationNullWithUserProfile () throws Exception {
529
529
final AtomicInteger bucketValue = new AtomicInteger ();
530
530
UserProfile userProfile = mock (UserProfile .class );
531
- Bucketer algorithm = mockUserExperimentRecordAlgorithm (bucketValue , userProfile );
531
+ Bucketer algorithm = mockUserProfileAlgorithm (bucketValue , userProfile );
532
532
bucketValue .set (3000 );
533
533
534
534
ProjectConfig projectConfig = validProjectConfigV2 ();
@@ -541,53 +541,53 @@ public void bucketUserNotInOverlappingGroupExperiment() throws Exception {
541
541
assertThat (algorithm .bucket (groupExperiment , "blah" ), is (variation ));
542
542
543
543
logbackVerifier .expectMessage (Level .INFO , "No previously activated variation of experiment " +
544
- "\" group_etag2\" for user \" blah\" found in user experiment record ." );
544
+ "\" group_etag2\" for user \" blah\" found in user profile ." );
545
545
verify (userProfile ).lookup ("blah" , groupExperiment .getKey ());
546
546
}
547
547
548
548
/**
549
- * Verify {@link Bucketer#cleanUserExperimentRecords ()} handles a null {@link UserProfile}.
549
+ * Verify {@link Bucketer#cleanUserProfiles ()} handles a null {@link UserProfile}.
550
550
*/
551
551
@ Test
552
- public void nullUserExperimentRecordWhenCleaning () {
552
+ public void nullUserProfileWhenCleaning () {
553
553
final AtomicInteger bucketValue = new AtomicInteger ();
554
554
Bucketer algorithm = mockBucketAlgorithm (bucketValue );
555
555
bucketValue .set (3000 );
556
556
try {
557
- algorithm .cleanUserExperimentRecords ();
557
+ algorithm .cleanUserProfiles ();
558
558
} catch (NullPointerException e ) {
559
559
fail ();
560
560
}
561
561
}
562
562
563
563
/**
564
- * Verify {@link Bucketer#cleanUserExperimentRecords ()} handles a null returned from
564
+ * Verify {@link Bucketer#cleanUserProfiles ()} handles a null returned from
565
565
* {@link UserProfile#getAllRecords()}.
566
566
*/
567
567
@ Test
568
- public void nullUserExperimentRecords () {
568
+ public void nullUserProfiles () {
569
569
final AtomicInteger bucketValue = new AtomicInteger ();
570
570
UserProfile userProfile = mock (UserProfile .class );
571
- Bucketer algorithm = mockUserExperimentRecordAlgorithm (bucketValue , userProfile );
571
+ Bucketer algorithm = mockUserProfileAlgorithm (bucketValue , userProfile );
572
572
bucketValue .set (3000 );
573
573
574
574
when (userProfile .getAllRecords ()).thenReturn (null );
575
575
try {
576
- algorithm .cleanUserExperimentRecords ();
576
+ algorithm .cleanUserProfiles ();
577
577
} catch (NullPointerException e ) {
578
578
fail ();
579
579
}
580
580
}
581
581
582
582
/**
583
- * Verify {@link Bucketer#cleanUserExperimentRecords ()} removes experiments
583
+ * Verify {@link Bucketer#cleanUserProfiles ()} removes experiments
584
584
* that are no longer in the {@link ProjectConfig}.
585
585
*/
586
586
@ Test
587
587
public void cleanRemovesRecordsOfExperimentsThatNoLongerExist () {
588
588
final AtomicInteger bucketValue = new AtomicInteger ();
589
589
UserProfile userProfile = mock (UserProfile .class );
590
- Bucketer algorithm = mockUserExperimentRecordAlgorithm (bucketValue , userProfile );
590
+ Bucketer algorithm = mockUserProfileAlgorithm (bucketValue , userProfile );
591
591
bucketValue .set (3000 );
592
592
593
593
Map <String ,Map <String ,String >> records = new HashMap <String , Map <String , String >>();
@@ -596,20 +596,20 @@ public void cleanRemovesRecordsOfExperimentsThatNoLongerExist() {
596
596
records .put ("blah" , activation );
597
597
when (userProfile .getAllRecords ()).thenReturn (records );
598
598
599
- algorithm .cleanUserExperimentRecords ();
599
+ algorithm .cleanUserProfiles ();
600
600
601
601
verify (userProfile ).remove ("blah" , "exp1" );
602
602
}
603
603
604
604
/**
605
- * Verify {@link Bucketer#cleanUserExperimentRecords ()} removes experiments
605
+ * Verify {@link Bucketer#cleanUserProfiles ()} removes experiments
606
606
* that are paused in the {@link ProjectConfig}.
607
607
*/
608
608
@ Test
609
609
public void cleanRemovesRecordsOfExperimentsThatAreNotRunning () {
610
610
final AtomicInteger bucketValue = new AtomicInteger ();
611
611
UserProfile userProfile = mock (UserProfile .class );
612
- Bucketer algorithm = mockUserExperimentRecordAlgorithm (bucketValue , userProfile );
612
+ Bucketer algorithm = mockUserProfileAlgorithm (bucketValue , userProfile );
613
613
bucketValue .set (3000 );
614
614
615
615
Map <String ,Map <String ,String >> records = new HashMap <String , Map <String , String >>();
@@ -618,7 +618,7 @@ public void cleanRemovesRecordsOfExperimentsThatAreNotRunning() {
618
618
records .put ("blah" , activation );
619
619
when (userProfile .getAllRecords ()).thenReturn (records );
620
620
621
- algorithm .cleanUserExperimentRecords ();
621
+ algorithm .cleanUserProfiles ();
622
622
623
623
verify (userProfile ).remove ("blah" , "exp1" );
624
624
}
@@ -647,7 +647,7 @@ int generateBucketValue(int hashCode) {
647
647
* @param bucketValue the expected bucket value holder
648
648
* @return the mock bucket algorithm
649
649
*/
650
- private Bucketer mockUserExperimentRecordAlgorithm (final AtomicInteger bucketValue , final UserProfile userProfile ) {
650
+ private Bucketer mockUserProfileAlgorithm (final AtomicInteger bucketValue , final UserProfile userProfile ) {
651
651
return new Bucketer (validProjectConfigV2 (), userProfile ) {
652
652
@ Override
653
653
int generateBucketValue (int hashCode ) {
0 commit comments