Class EntityManagerFactoryExtension

  • All Implemented Interfaces:
    org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.Extension, org.junit.jupiter.api.extension.TestExecutionExceptionHandler, org.junit.jupiter.api.extension.TestInstancePostProcessor

    public class EntityManagerFactoryExtension
    extends Object
    implements org.junit.jupiter.api.extension.TestInstancePostProcessor, org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.TestExecutionExceptionHandler
    hibernate-testing implementation of a few JUnit5 contracts to support SessionFactory-based testing, including argument injection (or see SessionFactoryScopeAware)
    See Also:
    DomainModelExtension, SessionFactoryExtension
    • Constructor Detail

      • EntityManagerFactoryExtension

        public EntityManagerFactoryExtension()
    • Method Detail

      • findEntityManagerFactoryScope

        public static EntityManagerFactoryScope findEntityManagerFactoryScope​(Object testInstance,
                                                                              org.junit.jupiter.api.extension.ExtensionContext context)
      • postProcessTestInstance

        public void postProcessTestInstance​(Object testInstance,
                                            org.junit.jupiter.api.extension.ExtensionContext context)
        Specified by:
        postProcessTestInstance in interface org.junit.jupiter.api.extension.TestInstancePostProcessor
      • afterAll

        public void afterAll​(org.junit.jupiter.api.extension.ExtensionContext context)
        Specified by:
        afterAll in interface org.junit.jupiter.api.extension.AfterAllCallback
      • handleTestExecutionException

        public void handleTestExecutionException​(org.junit.jupiter.api.extension.ExtensionContext context,
                                                 Throwable throwable)
                                          throws Throwable
        Specified by:
        handleTestExecutionException in interface org.junit.jupiter.api.extension.TestExecutionExceptionHandler
        Throws:
        Throwable