@Test(expected = IllegalArgumentException.class) public void testNewExperimentStartNull() { NewExperiment newExperiment = NewExperiment.withID(Experiment.ID.newInstance()) .withDescription(DUMMY_DESCRIPTION) .withLabel(Experiment.Label.valueOf("l1")).build(); experimentValidator.validateNewExperiment(newExperiment); }
public void validateNewExperiment(NewExperiment newExperiment) { validateLabel(newExperiment.getLabel()); validateExperimentStartEnd(newExperiment.getStartTime(), newExperiment.getEndTime()); validateSamplingPercent(newExperiment.getSamplingPercent()); validateExperimentRule(newExperiment.getRule()); validateModelNameNotNullForPersonalizedExperiments(newExperiment.getIsPersonalizationEnabled(), newExperiment.getModelName()); validateDescriptionNotEmpty(newExperiment.getDescription()); }
ExperimentValidator { public void validateNewExperiment(NewExperiment newExperiment) { validateLabel(newExperiment.getLabel()); validateExperimentStartEnd(newExperiment.getStartTime(), newExperiment.getEndTime()); validateSamplingPercent(newExperiment.getSamplingPercent()); validateExperimentRule(newExperiment.getRule()); validateModelNameNotNullForPersonalizedExperiments(newExperiment.getIsPersonalizationEnabled(), newExperiment.getModelName()); validateDescriptionNotEmpty(newExperiment.getDescription()); } }
ExperimentValidator { public void validateNewExperiment(NewExperiment newExperiment) { validateLabel(newExperiment.getLabel()); validateExperimentStartEnd(newExperiment.getStartTime(), newExperiment.getEndTime()); validateSamplingPercent(newExperiment.getSamplingPercent()); validateExperimentRule(newExperiment.getRule()); validateModelNameNotNullForPersonalizedExperiments(newExperiment.getIsPersonalizationEnabled(), newExperiment.getModelName()); validateDescriptionNotEmpty(newExperiment.getDescription()); } ExperimentValidator(); }
ExperimentValidator { public void validateNewExperiment(NewExperiment newExperiment) { validateLabel(newExperiment.getLabel()); validateExperimentStartEnd(newExperiment.getStartTime(), newExperiment.getEndTime()); validateSamplingPercent(newExperiment.getSamplingPercent()); validateExperimentRule(newExperiment.getRule()); validateModelNameNotNullForPersonalizedExperiments(newExperiment.getIsPersonalizationEnabled(), newExperiment.getModelName()); validateDescriptionNotEmpty(newExperiment.getDescription()); } ExperimentValidator(); void validateExperiment(Experiment experiment); void validateNewExperiment(NewExperiment newExperiment); void validateStateTransition(Experiment.State oldState, Experiment.State newState); void validateExperimentBuckets(List<Bucket> buckets); void ensureStateIsDraft(Experiment experiment); void validateBucketStateTransition(Bucket.State oldState, Bucket.State desiredState); void validateDescriptionNotEmpty(String description); }
ExperimentValidator { public void validateNewExperiment(NewExperiment newExperiment) { validateLabel(newExperiment.getLabel()); validateExperimentStartEnd(newExperiment.getStartTime(), newExperiment.getEndTime()); validateSamplingPercent(newExperiment.getSamplingPercent()); validateExperimentRule(newExperiment.getRule()); validateModelNameNotNullForPersonalizedExperiments(newExperiment.getIsPersonalizationEnabled(), newExperiment.getModelName()); validateDescriptionNotEmpty(newExperiment.getDescription()); } ExperimentValidator(); void validateExperiment(Experiment experiment); void validateNewExperiment(NewExperiment newExperiment); void validateStateTransition(Experiment.State oldState, Experiment.State newState); void validateExperimentBuckets(List<Bucket> buckets); void ensureStateIsDraft(Experiment experiment); void validateBucketStateTransition(Bucket.State oldState, Bucket.State desiredState); void validateDescriptionNotEmpty(String description);  }