@Test
public void testDeletePendingRoleMember()  throws Exception {

    JDBCConnection jdbcConn = new JDBCConnection(mockConn, true);
    Mockito.when(mockResultSet.getInt(1))
            .thenReturn(5) // domain id
            .thenReturn(7) // role id
            .thenReturn(9); // principal id
    Mockito.when(mockResultSet.next())
            .thenReturn(true) // this one is for domain id
            .thenReturn(true) // this one is for role id
            .thenReturn(true); // principal id
    Mockito.doReturn(1).when(mockPrepStmt).executeUpdate();
    boolean requestSuccess = jdbcConn.deletePendingRoleMember("my-domain", "role1", "user.user1",
            "user.admin", "audit-ref");
    assertTrue(requestSuccess);
    // this is combined for all operations above
    Mockito.verify(mockPrepStmt, times(1)).setString(1, "my-domain");
    Mockito.verify(mockPrepStmt, times(1)).setInt(1, 5);
    Mockito.verify(mockPrepStmt, times(1)).setString(2, "role1");
    Mockito.verify(mockPrepStmt, times(1)).setString(1, "user.user1");
    // we need additional operation for the audit log
    Mockito.verify(mockPrepStmt, times(2)).setInt(1, 7);
    Mockito.verify(mockPrepStmt, times(1)).setInt(2, 9);
    // the rest of the audit log details
    Mockito.verify(mockPrepStmt, times(1)).setString(2, "user.admin");
    Mockito.verify(mockPrepStmt, times(1)).setString(3, "user.user1");
    Mockito.verify(mockPrepStmt, times(1)).setString(4, "REJECT");
    Mockito.verify(mockPrepStmt, times(1)).setString(5, "audit-ref");
    jdbcConn.close();
}