@Test
public void testListServiceIdentities() throws Exception {

    
    JDBCConnection jdbcConn = new JDBCConnection(mockConn, true);
    Mockito.doReturn(5).when(mockResultSet).getInt(1); // return domain id
    
    Mockito.when(mockResultSet.next())
        .thenReturn(true) // this one is for domain id
        .thenReturn(true)
        .thenReturn(true)
        .thenReturn(true)
        .thenReturn(false);
    Mockito.when(mockResultSet.getString(1))
        .thenReturn("zservice")
        .thenReturn("aservice")
        .thenReturn("bservice");
    
    List<String> services = jdbcConn.listServiceIdentities("my-domain");
    
    // data back is sorted
    
    assertEquals(3, services.size());
    assertEquals("aservice", services.get(0));
    assertEquals("bservice", services.get(1));
    assertEquals("zservice", services.get(2));
    jdbcConn.close();
}