Package org.jdbi.v3.testing.junit5
Class JdbiOtjPostgresExtension
java.lang.Object
org.jdbi.v3.testing.junit5.JdbiExtension
org.jdbi.v3.testing.junit5.JdbiOtjPostgresExtension
- All Implemented Interfaces:
AfterAllCallback
,AfterEachCallback
,BeforeAllCallback
,BeforeEachCallback
,Extension
,ParameterResolver
@Deprecated(since="3.41.2",
forRemoval=true)
public class JdbiOtjPostgresExtension
extends JdbiExtension
Deprecated, for removal: This API element is subject to removal in a future version.
The OtjPostgres project ships its artifact as an automatic module with filename
based module name. It is strongly discouraged to ship any JPMS enabled project that depends on automatic modules with filename based module names. We
have reached out to the OtjPostgres project and proposed a change that would fix this.
If they ship a version that fixes this before we are ready to move to full JPMS support, we will un-deprecate this class, otherwise it will be removed
with our switch to JPMS.
Jdbi PostgreSQL JUnit 5 rule using the otj-pg-embedded component.
Override methods for special case construction:
@RegisterExtension
public JdbiExtension extension = new JdbiOtjPostgresExtension() {
@Override
protected DataSource createDataSource() {
...
}
};
Use with ExtendWith
:
@ExtendWith(JdbiOtjPostgresExtension.class)
public class DatabaseTest {
@Test
public void testWithJdbi(Jdbi jdbi) {
...
}
@Test
public void testWithHandle(Handle handle) {
...
}
}
-
Constructor Summary
ConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.getUrl()
Deprecated, for removal: This API element is subject to removal in a future version.Returns a JDBC url representing the data source used by this extension.Methods inherited from class org.jdbi.v3.testing.junit5.JdbiExtension
afterAll, afterEach, attach, beforeAll, beforeEach, enableLeakChecker, externalPostgres, getJdbi, getSharedHandle, h2, installPlugins, openHandle, otjEmbeddedPostgres, postgres, resolveParameter, sqlite, supportsParameter, withConfig, withInitializer, withPlugin, withPlugins
-
Constructor Details
-
JdbiOtjPostgresExtension
public JdbiOtjPostgresExtension()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
getUrl
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:JdbiExtension
Returns a JDBC url representing the data source used by this extension. This url is database-specific and may or may not be used to connect to the data source outside testing code that uses this extension (e.g. theJdbiSqliteExtension
returns a constant uri for all database instances).- Specified by:
getUrl
in classJdbiExtension
- Returns:
- A string representing the JDBC URL.
-
customize
public JdbiOtjPostgresExtension customize(Consumer<com.opentable.db.postgres.embedded.EmbeddedPostgres.Builder> customizer) Deprecated, for removal: This API element is subject to removal in a future version.
-