@Test
public void testListAssertions() throws Exception {

    
    JDBCConnection jdbcConn = new JDBCConnection(mockConn, true);
    Mockito.when(mockResultSet.getInt(1)).thenReturn(5).thenReturn(7); // return domain/policy id
    
    Mockito.when(mockResultSet.next())
        .thenReturn(true) // this one is for domain id
        .thenReturn(true) // this one is for policy id
        .thenReturn(true)
        .thenReturn(true)
        .thenReturn(false);
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_ROLE))
        .thenReturn("role1")
        .thenReturn("role2");
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_RESOURCE))
        .thenReturn("my-domain:*")
        .thenReturn("my-domain:service.*");
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_ACTION))
        .thenReturn("*")
        .thenReturn("read");
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_EFFECT))
        .thenReturn("ALLOW")
        .thenReturn("DENY");
    
    List<Assertion> assertions = jdbcConn.listAssertions("my-domain", "policy1");
    
    assertEquals(2, assertions.size());
    assertEquals("my-domain:role.role1", assertions.get(0).getRole());
    assertEquals("my-domain:*", assertions.get(0).getResource());
    assertEquals("*", assertions.get(0).getAction());
    assertEquals("ALLOW", assertions.get(0).getEffect().toString());
    
    assertEquals("my-domain:role.role2", assertions.get(1).getRole());
    assertEquals("my-domain:service.*", assertions.get(1).getResource());
    assertEquals("read", assertions.get(1).getAction());
    assertEquals("DENY", assertions.get(1).getEffect().toString());
    jdbcConn.close();
}