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.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static org.testcontainers.containers.PostgreSQLContainer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddLateSpringContextProperties(org.springframework.test.context.DynamicPropertyRegistry registry) voidafterAll(org.junit.jupiter.api.extension.ExtensionContext context) voidbeforeAll(org.junit.jupiter.api.extension.ExtensionContext context)
-
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:
beforeAllin interfaceorg.junit.jupiter.api.extension.BeforeAllCallback
-
afterAll
public void afterAll(org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
afterAllin interfaceorg.junit.jupiter.api.extension.AfterAllCallback
-