@Test(expected = ExperimentNotFoundException.class) public void getExperimentIfExistsTest() { Experiment.ID id = Experiment.ID.newInstance(); Experiment experiment = mock(Experiment.class); when(experiments.getExperiment(eq(id))).thenReturn(experiment); Experiment result = this.analyticsImpl.getExperimentIfExists(id); assertThat(result, is(experiment)); when(experiments.getExperiment(not(eq(id)))).thenReturn(null); result = this.analyticsImpl.getExperimentIfExists(Experiment.ID.newInstance()); Assert.fail(); }
Experiment getExperimentIfExists(final Experiment.ID experimentID) { Experiment experiment = experiments.getExperiment(experimentID); if (experiment == null) { throw new ExperimentNotFoundException(experimentID); } return experiment; }
AnalyticsImpl implements Analytics { Experiment getExperimentIfExists(final Experiment.ID experimentID) { Experiment experiment = experiments.getExperiment(experimentID); if (experiment == null) { throw new ExperimentNotFoundException(experimentID); } return experiment; } }
AnalyticsImpl implements Analytics { Experiment getExperimentIfExists(final Experiment.ID experimentID) { Experiment experiment = experiments.getExperiment(experimentID); if (experiment == null) { throw new ExperimentNotFoundException(experimentID); } return experiment; } @Inject  AnalyticsImpl(final Experiments experiments, final AssignmentsRepository assignmentRepository,
                         final TransactionFactory dataTransactorFactory, final AnalyticsRepository analyticsRepository,
                         final AnalysisTools analysisTools,
                         final @CassandraRepository ExperimentRepository cassandraRepository); }
AnalyticsImpl implements Analytics { Experiment getExperimentIfExists(final Experiment.ID experimentID) { Experiment experiment = experiments.getExperiment(experimentID); if (experiment == null) { throw new ExperimentNotFoundException(experimentID); } return experiment; } @Inject  AnalyticsImpl(final Experiments experiments, final AssignmentsRepository assignmentRepository,
                         final TransactionFactory dataTransactorFactory, final AnalyticsRepository analyticsRepository,
                         final AnalysisTools analysisTools,
                         final @CassandraRepository ExperimentRepository cassandraRepository); @Override ExperimentCounts getExperimentRollup(final Experiment.ID experimentID, final Parameters parameters); @Override ExperimentCounts getExperimentCounts(final Experiment.ID experimentID, final Parameters parameters); @Override ExperimentCumulativeCounts getExperimentRollupDailies(final Experiment.ID experimentID,
                                                                 final Parameters parameters); @Override ExperimentCumulativeCounts getExperimentCountsDailies(final Experiment.ID experimentId, final Parameters parameters); @Override ExperimentStatistics getExperimentStatistics(final Experiment.ID experimentId, final Parameters parameters); @Override ExperimentCumulativeStatistics getExperimentStatisticsDailies(final Experiment.ID experimentId,
                                                                         final Parameters parameters); @Override AssignmentCounts getAssignmentCounts(Experiment.ID experimentID, Context context); }
AnalyticsImpl implements Analytics { Experiment getExperimentIfExists(final Experiment.ID experimentID) { Experiment experiment = experiments.getExperiment(experimentID); if (experiment == null) { throw new ExperimentNotFoundException(experimentID); } return experiment; } @Inject  AnalyticsImpl(final Experiments experiments, final AssignmentsRepository assignmentRepository,
                         final TransactionFactory dataTransactorFactory, final AnalyticsRepository analyticsRepository,
                         final AnalysisTools analysisTools,
                         final @CassandraRepository ExperimentRepository cassandraRepository); @Override ExperimentCounts getExperimentRollup(final Experiment.ID experimentID, final Parameters parameters); @Override ExperimentCounts getExperimentCounts(final Experiment.ID experimentID, final Parameters parameters); @Override ExperimentCumulativeCounts getExperimentRollupDailies(final Experiment.ID experimentID,
                                                                 final Parameters parameters); @Override ExperimentCumulativeCounts getExperimentCountsDailies(final Experiment.ID experimentId, final Parameters parameters); @Override ExperimentStatistics getExperimentStatistics(final Experiment.ID experimentId, final Parameters parameters); @Override ExperimentCumulativeStatistics getExperimentStatisticsDailies(final Experiment.ID experimentId,
                                                                         final Parameters parameters); @Override AssignmentCounts getAssignmentCounts(Experiment.ID experimentID, Context context); static final String PROPERTY_NAME; }