@Test
public void testPassword() {

    AdminUserResource resource = new AdminUserResource();
    // Inject OSGi services into the resource
    UserManagementService useradmin = mock(UserManagementService.class);
    when(useradmin.updatePassword(any())).thenReturn(getUsersForUserManagement());
    resource.useradmin = useradmin;
    UkelonnService ukelonn = mock(UkelonnService.class);
    resource.ukelonn = ukelonn;
    MockLogService logservice = new MockLogService();
    resource.logservice = logservice;
    // Get first user and modify all properties except id
    List<User> users = getUsersForUserManagement();
    User user = users.get(0);
    // Create a passwords object containing the user and with
    // valid and identical passwords
    UserAndPasswords passwords = new UserAndPasswords(user, "zecret", "zecret", false);
    // Change the password
    List<User> updatedUsers = resource.password(passwords);
    // Verify that the size of the users list hasn't changed
    // (passwords can't be downloaded so we can't check the change)
    assertEquals(users.size(), updatedUsers.size());
}