MysqlEventSource implements EventSource { @Override public void connect() throws DataAccessException { if (!isConnected()) { connection = connectionProvider.getConnection(); listener = listenerRepo.insert(new Listener(tableName), connection); } } MysqlEventSource(ConnectionProvider connectionProvider, String tableName); @VisibleForTesting  MysqlEventSource(ConnectionProvider connectionProvider, String tableName, MysqlConfigurator configurator); @Override List<Event<Map<String, Object>>> getNewEvents(); @Override void connect(); @Override void disconnect(); @Override boolean isConnected(); @Override void setup(); @Override void cleanup();  }
@Test(groups = INTEGRATION) public void testConnectCreatesCorrectEntryInListenerTable() throws SQLException { MysqlEventSource eventSource = new MysqlEventSource(provider, TEST_TABLE_NAME); eventSource.connect(); assertEquals(listAllListeners().size(), 1); }