JdbcConsumerManager implements ConsumerManager { @Override @SuppressWarnings("squid:S1166") public void close() { try { this.upsertStatement.close(); this.connection.close(); } catch (SQLException e) { } } JdbcConsumerManager(Path path);  JdbcConsumerManager(Path path, long acknowledgeRate); @Override long getOffset(String consumer); @Override void acknowledgeOffset(String consumer, long offset, boolean useAcknowledgeRate); @Override @SuppressWarnings("squid:S1166") // Do not log SQL Exception void close(); final long acknowledgeRate; }
@Test public void initialize() throws SQLException { JdbcConsumerManager consumer = createJdbcConsumerManager(); assertFalse(consumer.connection.isClosed()); ResultSet resultSet; try (Statement statement = consumer.connection.createStatement()) { resultSet = statement.executeQuery("SELECT * FROM CONSUMER"); } assertNotNull(resultSet); consumer.close(); }