PsqlEventSource implements EventSource { @Override public List<Event<Map<String, Object>>> getNewEvents() throws DataAccessException { state(connection != null, ERROR_MSG_ILLEGALSTATE); try { PGNotification[] notifications = getLatestEvents(); return parseNotificationsArray(notifications); } catch (SQLException sqle) { throw new DataAccessException(ERROR_MSG_GET_NEW_NOTIFICATIONS + streamName, sqle); } catch (InvalidPayloadException ipe) { throw new DataAccessException("Could not parse notification payload.", ipe); } } 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();  }
@Test(groups = SMALL, expectedExceptions = IllegalStateException.class) public void testGetNewThrowsAnIllegalStateExceptionEventsBeforeConnectionIfCalledBefoforeConnect() { eventSource.getNewEvents(); }