Class ExpressionExperimentServiceDetachedEntityTest

java.lang.Object
ubic.gemma.core.util.test.BaseTest5
ubic.gemma.core.util.test.BaseDatabaseTest5
ubic.gemma.persistence.service.expression.experiment.ExpressionExperimentServiceDetachedEntityTest

@ContextConfiguration public class ExpressionExperimentServiceDetachedEntityTest extends BaseDatabaseTest5
ExpressionExperimentService.isSingleCell(ExpressionExperiment) must not require its argument to be attached to a session.

🛑 This exists because a mocked test cannot catch the failure. isSingleCell reads the lazy characteristics collection, and every REST-layer test mocks the service, so the transaction boundary is never crossed. It shipped and 500ed every call to GET /datasets/{id}/sample-correlation on production — including datasets the caller's gate was never meant to touch — with "failed to lazily initialize a collection of role: Investigation.characteristics: could not initialize proxy - no Session" (2026-08-31, fixed in the same commit as this test).

⚠️ BaseDatabaseTest5 is @Transactional at class level, so an entity created here stays attached and the test would pass with or without the fix. The evict below is what makes it a real test: without it this guard cannot fail.

  • Constructor Details

    • ExpressionExperimentServiceDetachedEntityTest

      public ExpressionExperimentServiceDetachedEntityTest()
  • Method Details

    • setUp

      @BeforeEach public void setUp()
    • testIsSingleCellOnADetachedExperiment

      @Test public void testIsSingleCellOnADetachedExperiment()