ExperimentFilesCrossValidator { void sampleCharacteristicsNotMissing() { for (AssayGroup assayGroup: assayGroups.get()) { for (String assayGroupId: assayGroup.assaysAnalyzedForThisDataColumn()) { checkState(!experimentDesign.getSampleCharacteristics(assayGroupId).isEmpty(), MessageFormat.format( "Sample characteristics values for assay id {0} missing from experiment design file!", assayGroupId)); } } } ExperimentFilesCrossValidator(ExperimentConfiguration experimentConfiguration,
                                         ExperimentDesign experimentDesign); void validate();  }
@Test(expected = IllegalStateException.class) public void missingCharacteristicsThrow() { when(experimentDesign.getSampleCharacteristics("r2")).thenReturn(ImmutableList.of()); new ExperimentFilesCrossValidator(experimentConfiguration, experimentDesign).sampleCharacteristicsNotMissing(); }
@Test public void presentCharacteristicsPass() { when(experimentDesign.getSampleCharacteristics("r1")) .thenReturn(ImmutableList.of(SampleCharacteristic.create("", ""))); when(experimentDesign.getSampleCharacteristics("r2")) .thenReturn(ImmutableList.of(SampleCharacteristic.create("", ""))); new ExperimentFilesCrossValidator(experimentConfiguration, experimentDesign).sampleCharacteristicsNotMissing(); }