Class JdbiH2Extension

java.lang.Object
org.jdbi.v3.testing.junit5.JdbiExtension
org.jdbi.v3.testing.junit5.JdbiH2Extension
All Implemented Interfaces:
AfterAllCallback, AfterEachCallback, BeforeAllCallback, BeforeEachCallback, Extension, ParameterResolver

public class JdbiH2Extension extends JdbiExtension
Jdbi H2 JUnit 5 rule. Override methods for special case construction:

     @RegisterExtension
     public JdbiExtension extension = new JdbiH2Extension() {
         @Override
         protected DataSource createDataSource() {
            ...
         }
     };
 
Use with ExtendWith:

 @ExtendWith(JdbiH2Extension.class)
 public class DatabaseTest {
     @Test
     public void testWithJdbi(Jdbi jdbi) {
         ...
     }

     @Test
     public void testWithHandle(Handle handle) {
         ...
     }
 }