@Test
public void testGetTrustedRoles() 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("trole1")
        .thenReturn("trole2")
        .thenReturn("trole3");
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_DOMAIN_ID))
        .thenReturn("101")
        .thenReturn("102")
        .thenReturn("103");
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_ROLE))
        .thenReturn("role1")
        .thenReturn("role1")
        .thenReturn("role3");
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_ASSERT_DOMAIN_ID))
        .thenReturn("101")
        .thenReturn("101")
        .thenReturn("103");
    
    Map<String, List<String>> trustedRoles = jdbcConn.getTrustedRoles("getTrustedRoles");
    assertEquals(2, trustedRoles.size());
    
    List<String> roles = trustedRoles.get("101:role1");
    assertEquals(2, roles.size());
    assertEquals("101:trole1", roles.get(0));
    assertEquals("102:trole2", roles.get(1));
    
    roles = trustedRoles.get("103:role3");
    assertEquals(1, roles.size());
    assertEquals("103:trole3", roles.get(0));
    
    jdbcConn.close();
}