use of com.palantir.nexus.db.sql.AgnosticResultSetImpl in project atlasdb by palantir.
the class PostgresDdlTableTest method setUpSqlConnection.
private SqlConnection setUpSqlConnection(Long lastVacuumTimestamp, Long currentTimestamp) {
SqlConnection sqlConnection = mock(SqlConnection.class);
when(connectionSupplier.get()).thenReturn(sqlConnection);
List<List<Object>> selectResults = new ArrayList<>();
selectResults.add(Arrays.asList(new Object[] { lastVacuumTimestamp, currentTimestamp }));
Mockito.when(sqlConnection.selectResultSetUnregisteredQuery(startsWith("SELECT FLOOR"), any())).thenReturn(new AgnosticResultSetImpl(selectResults, DBType.POSTGRESQL, // upper-case and lower-case, as postgres allows the query to have either of them.
new ImmutableMap.Builder<String, Integer>().put("last", 0).put("LAST", 0).put("current", 1).put("CURRENT", 1).build()));
return sqlConnection;
}
Aggregations