@Test(expected = NullPointerException.class) public void testConfigureRequiredUser() { manager.configure(newContext("driver", "url", null, "password")); }
@Override public void configure(final Context context) { driver = context.getString("driver"); Preconditions.checkNotNull(driver, "Driver must be specified."); url = context.getString("url"); Preconditions.checkNotNull(url, "URL must be specified."); user = context.getString("user"); Preconditions.checkNotNull(user, "User must be specified."); password = context.getString("password"); Preconditions.checkNotNull(password, "Driver must be specified."); }
JDBCConnectionManager implements Configurable { @Override public void configure(final Context context) { driver = context.getString("driver"); Preconditions.checkNotNull(driver, "Driver must be specified."); url = context.getString("url"); Preconditions.checkNotNull(url, "URL must be specified."); user = context.getString("user"); Preconditions.checkNotNull(user, "User must be specified."); password = context.getString("password"); Preconditions.checkNotNull(password, "Driver must be specified."); } }
JDBCConnectionManager implements Configurable { @Override public void configure(final Context context) { driver = context.getString("driver"); Preconditions.checkNotNull(driver, "Driver must be specified."); url = context.getString("url"); Preconditions.checkNotNull(url, "URL must be specified."); user = context.getString("user"); Preconditions.checkNotNull(user, "User must be specified."); password = context.getString("password"); Preconditions.checkNotNull(password, "Driver must be specified."); } JDBCConnectionManager(final SinkCounter counter); }
JDBCConnectionManager implements Configurable { @Override public void configure(final Context context) { driver = context.getString("driver"); Preconditions.checkNotNull(driver, "Driver must be specified."); url = context.getString("url"); Preconditions.checkNotNull(url, "URL must be specified."); user = context.getString("user"); Preconditions.checkNotNull(user, "User must be specified."); password = context.getString("password"); Preconditions.checkNotNull(password, "Driver must be specified."); } JDBCConnectionManager(final SinkCounter counter); @Override void configure(final Context context); Connection getConnection(); void start(); void ensureConnectionValid(); void closeConnection(); }
JDBCConnectionManager implements Configurable { @Override public void configure(final Context context) { driver = context.getString("driver"); Preconditions.checkNotNull(driver, "Driver must be specified."); url = context.getString("url"); Preconditions.checkNotNull(url, "URL must be specified."); user = context.getString("user"); Preconditions.checkNotNull(user, "User must be specified."); password = context.getString("password"); Preconditions.checkNotNull(password, "Driver must be specified."); } JDBCConnectionManager(final SinkCounter counter); @Override void configure(final Context context); Connection getConnection(); void start(); void ensureConnectionValid(); void closeConnection();  }