Assert.assertNull(permissions2);
}
@Test
public void testListDefaultPermissions() throws IOException {
PermissionInfo info = new PermissionInfo("Admin", "test", "get");
PermissionInfo[] permInfos = new PermissionInfo[] { info, info };
Mockito.when(permAdmin.getDefaultPermissions()).thenReturn(permInfos);
String[] permissions = mbean.listDefaultPermissions();
Assert.assertNotNull(permissions);
Assert.assertEquals(2, permissions.length);
Assert.assertArrayEquals("Checks encoded default permissions", new String[] { info.getEncoded(), info.getEncoded() },
permissions);
Mockito.reset(permAdmin);
Mockito.when(permAdmin.getDefaultPermissions()).thenReturn(null);
String[] permissions2 = mbean.listDefaultPermissions();