DefaultDatabase implements Database { public void start() { if (!started) { registerDriver(); if (databaseClient.isDropAndCreate()) { dropAndCreateDatabase(); } started = true; } } DefaultDatabase(Configuration config);  DefaultDatabase(DatabaseClient client); void start(); void stop(); @Override Map<String, String> getSonarProperties(); @Override DatabaseClient getClient(); @Override Database truncate(String tableName); @Override int countSql(String sql); @Override List<Map<String, String>> executeSql(String sql); @Override Connection openConnection(); @Override DefaultDatabase closeQuietly(@Nullable Connection connection); @Override void killOtherConnections();  }
@Test public void failIfUnknownDriver() { thrown.expect(RuntimeException.class); DefaultDatabase database = new DefaultDatabase(H2.builder().setDriverClassName("not.a.driver.Class").build()); database.start(); }