@Test(groups = SMALL) public void testConnectRegistersAListenerInPsqlForGivenStreamName() throws SQLException { Statement mockedStmt = mock(Statement.class); when(mockedConnection.createStatement()).thenReturn(mockedStmt); eventSource.connect(); verify(mockedStmt).execute("LISTEN " + STREAM_NAME); }
@Override public void connect() throws DataAccessException { if (!isConnected()) { connection = connectionProvider.getConnection(); } subscribeToStream(); }
PsqlEventSource implements EventSource { @Override public void connect() throws DataAccessException { if (!isConnected()) { connection = connectionProvider.getConnection(); } subscribeToStream(); } }
PsqlEventSource implements EventSource { @Override public void connect() throws DataAccessException { if (!isConnected()) { connection = connectionProvider.getConnection(); } subscribeToStream(); } PsqlEventSource(String dbUrl, String username, String password, String tableName);  PsqlEventSource(String dbUrl, String username, String password, String tableName, boolean autoConfig);  PsqlEventSource(ConnectionProvider connectionProvider, String tableName);  PsqlEventSource(ConnectionProvider connectionProvider, String tableName, boolean autoConfig); @VisibleForTesting  PsqlEventSource(ConnectionProvider connectionProvider, String tableName, PsqlEventMapper mapper,
                                       boolean autoConfig); @VisibleForTesting  PsqlEventSource(ConnectionProvider connectionProvider, String tableName, PsqlEventMapper mapper,
                           boolean autoConfig, PsqlConfigurator configurator); }
PsqlEventSource implements EventSource { @Override public void connect() throws DataAccessException { if (!isConnected()) { connection = connectionProvider.getConnection(); } subscribeToStream(); } PsqlEventSource(String dbUrl, String username, String password, String tableName);  PsqlEventSource(String dbUrl, String username, String password, String tableName, boolean autoConfig);  PsqlEventSource(ConnectionProvider connectionProvider, String tableName);  PsqlEventSource(ConnectionProvider connectionProvider, String tableName, boolean autoConfig); @VisibleForTesting  PsqlEventSource(ConnectionProvider connectionProvider, String tableName, PsqlEventMapper mapper,
                                       boolean autoConfig); @VisibleForTesting  PsqlEventSource(ConnectionProvider connectionProvider, String tableName, PsqlEventMapper mapper,
                           boolean autoConfig, PsqlConfigurator configurator); @Override List<Event<Map<String, Object>>> getNewEvents(); @Override void connect(); @Override void disconnect(); @Override boolean isConnected(); @Override void setup(); @Override void cleanup(); }
PsqlEventSource implements EventSource { @Override public void connect() throws DataAccessException { if (!isConnected()) { connection = connectionProvider.getConnection(); } subscribeToStream(); } PsqlEventSource(String dbUrl, String username, String password, String tableName);  PsqlEventSource(String dbUrl, String username, String password, String tableName, boolean autoConfig);  PsqlEventSource(ConnectionProvider connectionProvider, String tableName);  PsqlEventSource(ConnectionProvider connectionProvider, String tableName, boolean autoConfig); @VisibleForTesting  PsqlEventSource(ConnectionProvider connectionProvider, String tableName, PsqlEventMapper mapper,
                                       boolean autoConfig); @VisibleForTesting  PsqlEventSource(ConnectionProvider connectionProvider, String tableName, PsqlEventMapper mapper,
                           boolean autoConfig, PsqlConfigurator configurator); @Override List<Event<Map<String, Object>>> getNewEvents(); @Override void connect(); @Override void disconnect(); @Override boolean isConnected(); @Override void setup(); @Override void cleanup();  }