Class JdbiExtension

java.lang.Object
org.jdbi.v3.testing.junit5.JdbiExtension
All Implemented Interfaces:
AfterAllCallback, AfterEachCallback, BeforeAllCallback, BeforeEachCallback, Extension, ParameterResolver
Direct Known Subclasses:
JdbiExternalPostgresExtension, JdbiGenericExtension, JdbiH2Extension, JdbiOtjPostgresExtension, JdbiPostgresExtension, JdbiSqliteExtension, JdbiTestcontainersExtension

public abstract class JdbiExtension extends Object implements BeforeAllCallback, AfterAllCallback, BeforeEachCallback, AfterEachCallback, ParameterResolver
Common functionality for all JUnit 5 extensions.

Subclasses can be used with the @ExtendWith annotation to declare an extension if they provide a public no-args constructor.

When using declarative registration, test methods can declare a Jdbi and/or a Handle parameter which is injected through this extension. The getJdbi() is used to obtain the Jdbi object and getSharedHandle()} is used for the Handle instance.

Programmatic registration is preferred as this allows further customization of each extension.

See Also: