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