@Test
public void testGetPrincipalName() {

    
    Principal principal = SimplePrincipal.create("user", "user1", "creds", null);
    RsrcCtxWrapper rsrcCtx = Mockito.mock(RsrcCtxWrapper.class);
    Mockito.when(rsrcCtx.principal()).thenReturn(principal);
    assertEquals(zms.dbService.getPrincipalName(rsrcCtx), "user.user1");
    
    assertNull(zms.dbService.getPrincipalName(null));
    
    RsrcCtxWrapper rsrcCtx2 = Mockito.mock(RsrcCtxWrapper.class);
    Mockito.when(rsrcCtx2.principal()).thenReturn(null);
    assertNull(zms.dbService.getPrincipalName(rsrcCtx2));
}