@Test public void testGetDefaultDescription() throws Exception { Mockito.when(experiment.getLabel()).thenReturn(experimentLabel); Mockito.when(experimentLabel.toString()).thenReturn("UnitTestExperiment"); Mockito.when(bucket.getLabel()).thenReturn(bucketLabel); Mockito.when(bucketLabel.toString()).thenReturn("UnitTestBucket"); BucketChangeEvent systemEvent = new BucketChangeEvent(experiment, bucket, "label", "green", "blue"); Assert.assertEquals(EventLog.SYSTEM_USER.getUsername() + " changed property label of bucket UnitTestExperiment.UnitTestBucket from green to blue.", systemEvent.getDefaultDescription()); }
@Override public String getDefaultDescription() { return getUser().getUsername() + " changed property " + getPropertyName() + " of bucket " + getExperiment().getLabel() + "." + getBucket().getLabel() + " from " + getBefore() + " to " + getAfter() + "."; }
BucketChangeEvent extends AbstractChangeEvent implements BucketEvent { @Override public String getDefaultDescription() { return getUser().getUsername() + " changed property " + getPropertyName() + " of bucket " + getExperiment().getLabel() + "." + getBucket().getLabel() + " from " + getBefore() + " to " + getAfter() + "."; } }
BucketChangeEvent extends AbstractChangeEvent implements BucketEvent { @Override public String getDefaultDescription() { return getUser().getUsername() + " changed property " + getPropertyName() + " of bucket " + getExperiment().getLabel() + "." + getBucket().getLabel() + " from " + getBefore() + " to " + getAfter() + "."; } BucketChangeEvent(ExperimentBase experiment, Bucket bucket, String propertyName, String before, String after);  BucketChangeEvent(UserInfo user, ExperimentBase experiment, Bucket bucket, String propertyName, String before, String after); }
BucketChangeEvent extends AbstractChangeEvent implements BucketEvent { @Override public String getDefaultDescription() { return getUser().getUsername() + " changed property " + getPropertyName() + " of bucket " + getExperiment().getLabel() + "." + getBucket().getLabel() + " from " + getBefore() + " to " + getAfter() + "."; } BucketChangeEvent(ExperimentBase experiment, Bucket bucket, String propertyName, String before, String after);  BucketChangeEvent(UserInfo user, ExperimentBase experiment, Bucket bucket, String propertyName, String before, String after); @Override ExperimentBase getExperiment(); @Override Bucket getBucket(); @Override String getDefaultDescription(); @Override Application.Name getApplicationName(); }
BucketChangeEvent extends AbstractChangeEvent implements BucketEvent { @Override public String getDefaultDescription() { return getUser().getUsername() + " changed property " + getPropertyName() + " of bucket " + getExperiment().getLabel() + "." + getBucket().getLabel() + " from " + getBefore() + " to " + getAfter() + "."; } BucketChangeEvent(ExperimentBase experiment, Bucket bucket, String propertyName, String before, String after);  BucketChangeEvent(UserInfo user, ExperimentBase experiment, Bucket bucket, String propertyName, String before, String after); @Override ExperimentBase getExperiment(); @Override Bucket getBucket(); @Override String getDefaultDescription(); @Override Application.Name getApplicationName();  }