@Test public void testGetExperiment() throws Exception { Experiment testExp = Experiment.withID(experimentID) .withApplicationName(testApp) .withLabel(testLabel) .withSamplingPercent(samplingPercent) .withStartTime(startTime) .withEndTime(endTime).build(); when(cassandraRepository.getExperiment(experimentID)).thenReturn(null); Experiment experiment = expImpl.getExperiment(experimentID); assert experiment == null; experiment = expImpl.getExperiment(testApp, testLabel); assert experiment == null; when(cassandraRepository.getExperiment(experimentID)).thenReturn(testExp); experiment = expImpl.getExperiment(experimentID); assert experiment.getID() == experimentID; when(cassandraRepository.getExperiment(testApp, testLabel)).thenReturn(testExp); experiment = expImpl.getExperiment(testApp, testLabel); assert experiment.getID() == experimentID; List<Experiment> experiments = null; when(cassandraRepository.getExperiments(testApp)).thenReturn(null); experiments = expImpl.getExperiments(testApp); assert experiments == null; when(cassandraRepository.getExperiments()).thenReturn(null); ExperimentList experimentIDs = expImpl.getExperiments(); assert experimentIDs == null; }
@Override public Experiment getExperiment(Experiment.ID id) { return cassandraRepository.getExperiment(id); }
ExperimentsImpl implements Experiments { @Override public Experiment getExperiment(Experiment.ID id) { return cassandraRepository.getExperiment(id); } }
ExperimentsImpl implements Experiments { @Override public Experiment getExperiment(Experiment.ID id) { return cassandraRepository.getExperiment(id); } @Inject  ExperimentsImpl(@DatabaseRepository ExperimentRepository databaseRepository,
                           @CassandraRepository ExperimentRepository cassandraRepository, Experiments experiments,
                           Buckets buckets, Pages pages, Priorities priorities, ExperimentValidator validator,
                           RuleCache ruleCache, EventLog eventLog); }
ExperimentsImpl implements Experiments { @Override public Experiment getExperiment(Experiment.ID id) { return cassandraRepository.getExperiment(id); } @Inject  ExperimentsImpl(@DatabaseRepository ExperimentRepository databaseRepository,
                           @CassandraRepository ExperimentRepository cassandraRepository, Experiments experiments,
                           Buckets buckets, Pages pages, Priorities priorities, ExperimentValidator validator,
                           RuleCache ruleCache, EventLog eventLog); @Override ExperimentList getExperiments(); @Override List<Application.Name> getApplications(); @Override Map<Application.Name, Set<String>> getTagsForApplications(Collection<Application.Name> applicationNames); @Override Experiment getExperiment(Experiment.ID id); @Override Experiment getExperiment(Application.Name appName, Experiment.Label label); @Override List<Experiment> getExperiments(Application.Name appName); @Override void createExperiment(NewExperiment newExperiment, UserInfo user); @Override void checkStateTransition(Experiment.ID experimentID, Experiment.State currentState,
                                     Experiment.State desiredState); @Override void checkForIllegalUpdate(Experiment experiment, Experiment updates); @Override void checkForIllegalTerminatedUpdate(Experiment experiment, Experiment updates); @Override void checkForIllegalPausedRunningUpdate(Experiment experiment, Experiment updates); @Override boolean buildUpdatedExperiment(Experiment experiment, Experiment updates, Experiment.Builder builder,
                                          List<ExperimentAuditInfo> changeList); @Override void updateSegmentationRule(Experiment experiment, UserInfo user); @Override Experiment updateExperiment(final Experiment.ID experimentID, final Experiment updates, final UserInfo user); @Override void updateExperimentState(final Experiment experiment, final Experiment.State state); }
ExperimentsImpl implements Experiments { @Override public Experiment getExperiment(Experiment.ID id) { return cassandraRepository.getExperiment(id); } @Inject  ExperimentsImpl(@DatabaseRepository ExperimentRepository databaseRepository,
                           @CassandraRepository ExperimentRepository cassandraRepository, Experiments experiments,
                           Buckets buckets, Pages pages, Priorities priorities, ExperimentValidator validator,
                           RuleCache ruleCache, EventLog eventLog); @Override ExperimentList getExperiments(); @Override List<Application.Name> getApplications(); @Override Map<Application.Name, Set<String>> getTagsForApplications(Collection<Application.Name> applicationNames); @Override Experiment getExperiment(Experiment.ID id); @Override Experiment getExperiment(Application.Name appName, Experiment.Label label); @Override List<Experiment> getExperiments(Application.Name appName); @Override void createExperiment(NewExperiment newExperiment, UserInfo user); @Override void checkStateTransition(Experiment.ID experimentID, Experiment.State currentState,
                                     Experiment.State desiredState); @Override void checkForIllegalUpdate(Experiment experiment, Experiment updates); @Override void checkForIllegalTerminatedUpdate(Experiment experiment, Experiment updates); @Override void checkForIllegalPausedRunningUpdate(Experiment experiment, Experiment updates); @Override boolean buildUpdatedExperiment(Experiment experiment, Experiment updates, Experiment.Builder builder,
                                          List<ExperimentAuditInfo> changeList); @Override void updateSegmentationRule(Experiment experiment, UserInfo user); @Override Experiment updateExperiment(final Experiment.ID experimentID, final Experiment updates, final UserInfo user); @Override void updateExperimentState(final Experiment experiment, final Experiment.State state);  }