Class BaseDatabaseTest5

java.lang.Object
ubic.gemma.core.util.test.BaseTest5
ubic.gemma.core.util.test.BaseDatabaseTest5
Direct Known Subclasses:
AbstractServiceTest, AclLinterParentInheritanceTest, AclLinterServiceTest, AclSemanticsContractTest, AnalysisResultSetCacheStalenessTest, AnnotationRelationDaoTest, AnnotationRelationHarvestTest, ArrayDesignDaoTest, AuditEventDaoTest, BioAssayDimensionCacheStalenessTest, BioMaterialDaoTest, BlacklistedEntityDaoImplTest, CachedProcessedExpressionDataVectorServiceTest, CharacteristicDaoTest, ChebiSeedResolverSlotsTest, CompositeSequenceDaoTest, CuratableDaoTest, DifferentialExpressionAnalysisDaoTest, DifferentialExpressionResultDaoTest, ExperimentalFactorServiceTest, ExpressionAnalysisResultSetDaoTest, ExpressionExperimentDaoCursorTest, ExpressionExperimentDaoTest, ExpressionExperimentServiceDetachedEntityTest, ExpressionExperimentSetDaoTest, ExpressionExperimentSubSetDaoTest, FactorValueDaoTest, FactorValueServiceTest, GeneDaoTest, HibernateSqmFragileShapesIT, HqlSmokeIT, MexSingleCellDataLoaderPersistenceTest, ParentIdentityRetrievalStrategyTest, PreboardedExperimentMappingTest, PrincipalComponentAnalysisDaoImplTest, ProcessedExpressionDataVectorDaoTest, QuantitationTypeDaoTest, RawAndProcessedExpressionDataVectorDaoTest, RawExpressionDataVectorDaoTest, RawExpressionDataVectorTest, ReplaceAllRawDataVectorsQtCollisionTest, SingleCellDimensionCacheStalenessTest, SingleCellExpressionExperimentServiceTest, SingleCellStreamingAddTest, StatementTagPersistenceTest, UserDaoTest, UserManagerTest

@ActiveProfiles("test") @Transactional public abstract class BaseDatabaseTest5 extends BaseTest5
JUnit 5 (Jupiter) counterpart of BaseDatabaseTest.

Where BaseDatabaseTest inherits AbstractTransactionalJUnit4SpringContextTests to get JUnit 4-style per-test transaction wrapping, this base uses Spring's Transactional annotation directly. @Transactional at the class level — combined with the SpringExtension inherited from BaseTest5 — gives every test method a per-method transaction that is rolled back at end-of-test by default (Spring Test's standard TransactionalTestExecutionListener behaviour). This reproduces the JUnit 4 base class behaviour without inheriting from it.

The @ContextConfiguration location is intentionally NOT declared on this base; subclasses provide their own inner @Configuration class (extending BaseDatabaseTest5.BaseDatabaseTestContextConfiguration) the same way they did under the JUnit 4 base.

  • Field Details

  • Constructor Details

    • BaseDatabaseTest5

      public BaseDatabaseTest5()
  • Method Details

    • flushAndClearSession

      @AfterEach public final void flushAndClearSession()
      Flush and clear the session after each test.

      This ensures that any error in the test are caught and each test starts with a clean slate.