Mockito.when(user1.getType()).thenReturn(Role.USER);
Mockito.when(user1.getName()).thenReturn("user1");
Mockito.when(userAdmin.getRole(Mockito.anyString())).thenReturn(user1);
CompositeData data = mbean.getRole("user1");
Assert.assertNotNull(data);
RoleData role = RoleData.from(data);
Assert.assertNotNull(role);
Assert.assertEquals("user1", role.getName());
Assert.assertEquals(Role.USER, role.getType());
Mockito.verify(userAdmin).getRole(Mockito.anyString());
}