Class PostgresDBExtension

java.lang.Object
info.ejava.examples.svc.tcontainers.hello.extension.PostgresDBExtension
All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.Extension

public class PostgresDBExtension extends Object implements org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.AfterAllCallback
This class is an alternate approach to the generic TestContainerExtension and shows the starting poing to making container-management more local test framework specific.
  • Field Details

    • postgres

      private static org.testcontainers.containers.PostgreSQLContainer postgres
  • Constructor Details

    • PostgresDBExtension

      public PostgresDBExtension()
  • Method Details

    • addLateSpringContextProperties

      public static void addLateSpringContextProperties(org.springframework.test.context.DynamicPropertyRegistry registry)
    • beforeAll

      public void beforeAll(org.junit.jupiter.api.extension.ExtensionContext context)
      Specified by:
      beforeAll in interface org.junit.jupiter.api.extension.BeforeAllCallback
    • afterAll

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