Class BioAssayMetadataServiceImplTest

java.lang.Object
ubic.gemma.core.analysis.service.BioAssayMetadataServiceImplTest

public class BioAssayMetadataServiceImplTest extends Object

What this pins

The three columns this service writes are otherwise importer-only and unvalidated, so the tests that matter are the ones about refusing a bad value and about not manufacturing audit events.

Constructed directly rather than through @ContextConfiguration: there is no Spring wiring worth exercising here, and a context would make a fast test slow for nothing.

  • Constructor Details

    • BioAssayMetadataServiceImplTest

      public BioAssayMetadataServiceImplTest()
  • Method Details

    • setUp

      @BeforeEach public void setUp() throws Exception
      Throws:
      Exception
    • testSetLibraryStrategyWritesAndAuditsOnce

      @Test public void testSetLibraryStrategyWritesAndAuditsOnce()
    • testAlreadyHoldingTheValueIsNotWrittenAndNotAudited

      @Test public void testAlreadyHoldingTheValueIsNotWrittenAndNotAudited()
      A sample already holding the value is skipped. Without this a re-run would write an audit event recording a change that did not happen, which is worse than no record at all.
    • testUnknownLibraryStrategyIsRefusedAndNothingIsWritten

      @Test public void testUnknownLibraryStrategyIsRefusedAndNothingIsWritten()
    • testMicroarrayStrategiesAreAccepted

      @Test public void testMicroarrayStrategiesAreAccepted()
      Gemma's own microarray values are not in GeoLibraryStrategy and must still be accepted.
    • testNullClearsTheColumn

      @Test public void testNullClearsTheColumn()
      Clearing is a real curation act — a wrong strategy has to be removable, not just replaceable.
    • testExtractedMoleculeIsValidatedAgainstTheEnum

      @Test public void testExtractedMoleculeIsValidatedAgainstTheEnum()
    • testLibrarySelectionAcceptsFreeTextButEnforcesTheColumnLength

      @Test public void testLibrarySelectionAcceptsFreeTextButEnforcesTheColumnLength()
      🛑 librarySelection is deliberately NOT checked against a vocabulary — GeoSample keeps it as the submitter's raw string so that normalizing cannot drop a value we do not know. This test exists to make that a decision someone has to override on purpose rather than a gap they patch by accident.
    • testValidLibraryStrategiesCoversBothVocabularies

      @Test public void testValidLibraryStrategiesCoversBothVocabularies()