@Test
public void testListPrincipals() throws Exception {

    
    JDBCConnection jdbcConn = new JDBCConnection(mockConn, true);
    
    Mockito.when(mockResultSet.next())
        .thenReturn(true)
        .thenReturn(true)
        .thenReturn(true)
        .thenReturn(true)
        .thenReturn(false);
    Mockito.when(mockResultSet.getString(ZMSConsts.DB_COLUMN_NAME))
        .thenReturn("user.joe")
        .thenReturn("user.jane")
        .thenReturn("user.doe")
        .thenReturn("user.jack");
    
    List<String> principals = jdbcConn.listPrincipals("user");
    
    assertEquals(4, principals.size());
    assertTrue(principals.contains("user.joe"));
    assertTrue(principals.contains("user.jane"));
    assertTrue(principals.contains("user.doe"));
    assertTrue(principals.contains("user.jack"));
    jdbcConn.close();
}