Class EntityTestSupport

java.lang.Object
org.springframework.test.context.testng.AbstractTestNGSpringContextTests
it.tidalwave.datamanager.dao.impl.jpa.EntityTestSupport
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.testng.IHookable, org.testng.ITestNGListener
Direct Known Subclasses:
BackupEntityTest, BackupFileEntityTest, FingerprintEntityTest, ManagedFileEntityTest

public class EntityTestSupport extends org.springframework.test.context.testng.AbstractTestNGSpringContextTests
Adapted from ...
Author:
Fabrizio Giudici
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static enum 
     
  • Field Summary

    Fields inherited from class org.springframework.test.context.testng.AbstractTestNGSpringContextTests

    applicationContext, logger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected <T> void
    assertEqualityConsistency(Class<T> entityClass, T entity, EntityTestSupport.Options... options)
     
    protected void
    runInTx(Consumer<? super jakarta.persistence.EntityManager> task)
     
    protected <S> S
    runInTxWithResult(Function<? super jakarta.persistence.EntityManager,S> task)
     

    Methods inherited from class org.springframework.test.context.testng.AbstractTestNGSpringContextTests

    run, setApplicationContext, springTestContextAfterTestClass, springTestContextAfterTestMethod, springTestContextBeforeTestClass, springTestContextBeforeTestMethod, springTestContextPrepareTestInstance

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EntityTestSupport

      public EntityTestSupport()
  • Method Details

    • assertEqualityConsistency

      protected <T> void assertEqualityConsistency(@Nonnull Class<T> entityClass, @Nonnull T entity, @Nonnull EntityTestSupport.Options... options)
    • runInTx

      protected void runInTx(@Nonnull Consumer<? super jakarta.persistence.EntityManager> task)
    • runInTxWithResult

      @Nonnull protected <S> S runInTxWithResult(@Nonnull Function<? super jakarta.persistence.EntityManager,S> task)