@Test
public void testGetRoleAssertions() 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("dom1")
        .thenReturn("dom1")
        .thenReturn("dom2");
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_DOMAIN_ID))
        .thenReturn("101")
        .thenReturn("101")
        .thenReturn("102");
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_ROLE))
        .thenReturn("role1")
        .thenReturn("role1")
        .thenReturn("role3");
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_RESOURCE))
        .thenReturn("resource1")
        .thenReturn("resource2")
        .thenReturn("resource3");
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_ACTION))
        .thenReturn("update");
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_EFFECT))
        .thenReturn("ALLOW");
    
    Map<String, List<Assertion>> roleAssertions = jdbcConn.getRoleAssertions("update", "getRoleAssertions");
    assertEquals(2, roleAssertions.size());
    
    List<Assertion> assertions = roleAssertions.get("101:role1");
    assertEquals(2, assertions.size());
    assertEquals("dom1:role.role1", assertions.get(0).getRole());
    assertEquals("resource1", assertions.get(0).getResource());
    assertEquals("update", assertions.get(0).getAction());
    assertEquals("ALLOW", assertions.get(0).getEffect().toString());
    
    assertEquals("dom1:role.role1", assertions.get(1).getRole());
    assertEquals("resource2", assertions.get(1).getResource());
    assertEquals("update", assertions.get(1).getAction());
    assertEquals("ALLOW", assertions.get(1).getEffect().toString());
    
    assertions = roleAssertions.get("102:role3");
    assertEquals(1, assertions.size());
    assertEquals("dom2:role.role3", assertions.get(0).getRole());
    assertEquals("resource3", assertions.get(0).getResource());
    assertEquals("update", assertions.get(0).getAction());
    assertEquals("ALLOW", assertions.get(0).getEffect().toString());
    
    jdbcConn.close();
}