Class JdbiSqliteExtension

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

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

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

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

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

    • JdbiSqliteExtension

      public JdbiSqliteExtension()
    • JdbiSqliteExtension

      public JdbiSqliteExtension(String url)
  • Method Details

    • getUrl

      public String getUrl()
      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. the JdbiSqliteExtension returns a constant uri for all database instances).
      Specified by:
      getUrl in class JdbiExtension
      Returns:
      A string representing the JDBC URL.