@Test
public void testCountGroups() throws Exception {

    JDBCConnection jdbcConn = new JDBCConnection(mockConn, true);
    Mockito.when(mockResultSet.getInt(1)).thenReturn(5).thenReturn(7); // return domain/count
    Mockito.when(mockResultSet.next()).thenReturn(true);
    assertEquals(jdbcConn.countGroups("my-domain"), 7);
    jdbcConn.close();
}