@Test
public void testListServiceHosts() throws Exception {

    
    JDBCConnection jdbcConn = new JDBCConnection(mockConn, true);
    Mockito.when(mockResultSet.getInt(1))
    .thenReturn(5) // domain id
    .thenReturn(7); // service id
    
    Mockito.when(mockResultSet.next())
        .thenReturn(true) // this one is for domain id
        .thenReturn(true) // this one is for service id
        .thenReturn(true)
        .thenReturn(true)
        .thenReturn(true)
        .thenReturn(false);
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_NAME))
        .thenReturn("host1")
        .thenReturn("host3")
        .thenReturn("host2");
    
    List<String> serviceHosts = jdbcConn.listServiceHosts("my-domain", "service1");
    
    assertEquals(3, serviceHosts.size());
    assertEquals("host1", serviceHosts.get(0));
    assertEquals("host3", serviceHosts.get(1));
    assertEquals("host2", serviceHosts.get(2));
    jdbcConn.close();
}