ValueTypeLookup { public QcType resolveForSample(QcType qcType) { if (qcType == null) return null; if (qcType.isSaved()) return sampleQcTypeById.get(qcType.getId()); if (qcType.getName() != null) return sampleQcTypeByName.get(qcType.getName()); return null; } ValueTypeLookup(MisoServiceManager misoServiceManager); void addSubproject(Subproject subproject); boolean isValidSampleClass(String alias); boolean isValidTissueType(String alias); boolean isValidTissueMaterial(String alias); boolean isValidKitDescriptor(String name); boolean isValidSamplePurpose(String alias); boolean isValidLab(String labAlias, String instituteAlias); TissueOrigin resolve(TissueOrigin tissueOrigin); boolean isValidTissueOrigin(String aliasOrDescription); boolean isValidLibrarySelectionType(String name); boolean isValidLibraryStrategyType(String name); boolean isValidLibraryType(String description, String platformType); boolean isValidIndex(String familyName, String sequence); QcType resolveForSample(QcType qcType); boolean isValidSampleQcType(String name); QcType resolveForLibrary(QcType qcType); boolean isValidLibraryQcType(String name); boolean isValidInstrument(String name); boolean isValidSubproject(String alias); boolean isValidDetailedQcStatus(String description); void resolveAll(Sample sample); void resolveAll(Library library); void resolveAll(LibraryAliquot aliquot); void resolveAll(Run run); void resolveAll(Project project); void resolveAll(Box box);  }
@Test public void testResolveSampleQcType() { assertNotNull(sut.resolveForSample(makeQcType(VALID_LONG, null))); assertNotNull(sut.resolveForSample(makeQcType(null, VALID_STRING))); assertNull(sut.resolveForSample((QcType) null)); assertNull(sut.resolveForSample(makeQcType(null, null))); assertNull(sut.resolveForSample(makeQcType(INVALID_LONG, null))); assertNull(sut.resolveForSample(makeQcType(null, INVALID_STRING))); }