Allow overriding verifier database connection acquisition
@@ -108,7 +108,7 @@ public class PrestoVerifier
}
Set<EventClient> eventClients = injector.getInstance(Key.get(new TypeLiteral<Set<EventClient>>() {}));
- VerifierDao dao = new DBI(config.getQueryDatabase()).onDemand(VerifierDao.class);
+ VerifierDao dao = getQueryDatabase(injector).onDemand(VerifierDao.class);
ImmutableList.Builder<QueryPair> queriesBuilder = ImmutableList.builder();
for (String suite : config.getSuites()) {
@@ -188,6 +188,15 @@ public class PrestoVerifier
return urlList.build();
}
+ /**
+ * Override this method to use a different method of acquiring a database connection.
+ */
+ protected DBI getQueryDatabase(Injector injector)
+ {
+ VerifierConfig config = injector.getInstance(VerifierConfig.class);
+ return new DBI(config.getQueryDatabase());
+ }
+
/**
* Override this method to change the parser options used when parsing queries to decide if they match the allowed query types
*/
