Mockito.when(group1.getRequiredMembers()).thenReturn(new Role[] { role1 });
Mockito.when(group1.getMembers()).thenReturn(new Role[] { role2 });
Mockito.when(userAdmin.getRole(Mockito.anyString())).thenReturn(group1);
CompositeData data = mbean.getGroup("group1");
Assert.assertNotNull(data);
GroupData group = GroupData.from(data);
Assert.assertNotNull(group);
Assert.assertEquals("group1", group.getName());
Assert.assertEquals(Role.GROUP, group.getType());
Assert.assertArrayEquals(new String[] { "role2" }, group.getMembers());
Assert.assertArrayEquals(new String[] { "role1" }, group.getRequiredMembers());
Mockito.verify(userAdmin).getRole(Mockito.anyString());
}