@Test
public void testListDomains() throws Exception {

    
    JDBCConnection jdbcConn = new JDBCConnection(mockConn, true);
    Mockito.when(mockResultSet.next())
        .thenReturn(true)
        .thenReturn(true)
        .thenReturn(true)
        .thenReturn(false);
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_NAME))
        .thenReturn("zdomain")
        .thenReturn("adomain")
        .thenReturn("bdomain");
    List<String> domains = jdbcConn.listDomains(null, 0);
    
    // data back is sorted
    
    assertEquals(3, domains.size());
    assertEquals("adomain", domains.get(0));
    assertEquals("bdomain", domains.get(1));
    assertEquals("zdomain", domains.get(2));
    jdbcConn.close();
}