Add constants for app name and data source
@@ -7,13 +7,16 @@ import io.dropwizard.setup.Environment;
import org.jdbi.v3.core.Jdbi;
public class MarquezApplication extends Application<MarquezConfiguration> {
+ private static final String APP_NAME = "MarquezApp";
+ private static final String DATA_SOURCE_NAME = "postgresql";
+
public static void main(final String[] args) throws Exception {
new MarquezApplication().run(args);
}
@Override
public String getName() {
- return "MarquezApp";
+ return APP_NAME;
}
@Override
@@ -22,6 +25,6 @@ public class MarquezApplication extends Application<MarquezConfiguration> {
@Override
public void run(final MarquezConfiguration config, final Environment environment) {
final JdbiFactory factory = new JdbiFactory();
- final Jdbi jdbi = factory.build(environment, config.getDataSourceFactory(), "postgresql");
+ final Jdbi jdbi = factory.build(environment, config.getDataSourceFactory(), DATA_SOURCE_NAME);
}
}
