@Test
public void testGetPermissions() throws IOException {

    PermissionInfo info = new PermissionInfo("Admin", "test", "get");
    PermissionInfo[] permInfos = new PermissionInfo[] { info, info };
    Mockito.when(permAdmin.getPermissions(Mockito.anyString())).thenReturn(permInfos);
    String[] permissions = mbean.getPermissions("test");
    Assert.assertNotNull(permissions);
    Assert.assertEquals(2, permissions.length);
    Assert.assertArrayEquals("Checks encoded permissions", new String[] { info.getEncoded(), info.getEncoded() },
            permissions);
    
    Mockito.reset(permAdmin);
    Mockito.when(permAdmin.getPermissions(Mockito.anyString())).thenReturn(null);
    String[] permissions2 = mbean.getPermissions("test");
    Assert.assertNull(permissions2);
}