@Test
public void testGetImpliedRoles() throws IOException {

    User user1 = Mockito.mock(User.class);
    Authorization auth = Mockito.mock(Authorization.class);
    Mockito.when(user1.getType()).thenReturn(Role.USER);
    Mockito.when(auth.getRoles()).thenReturn(new String[] { "role1" });
    Mockito.when(userAdmin.getRole("role1")).thenReturn(user1);
    Mockito.when(userAdmin.getAuthorization(user1)).thenReturn(auth);
    String[] roles = mbean.getImpliedRoles("role1");
    Assert.assertArrayEquals(new String[] { "role1" }, roles);
}