@Test(expected=BadRequestException.class)
public void testPasswordWhenPasswordsDontMatch() {

    AdminUserResource resource = new AdminUserResource();
    // Inject OSGi services into the resource
    UserManagementServiceProvider useradmin = new UserManagementServiceProvider();
    resource.useradmin = useradmin;
    UkelonnService ukelonn = mock(UkelonnService.class);
    resource.ukelonn = ukelonn;
    MockLogService logservice = new MockLogService();
    resource.logservice = logservice;
    useradmin.setLogservice(logservice);
    // Get first user to get a user with valid username
    List<User> users = getUsersForUserManagement();
    User user = users.get(0);
    // Create a passwords object containing the user and with
    // valid but non-identical passwords
    UserAndPasswords passwords = new UserAndPasswords(user, "zecret", "secret", true);
    // Changing the password should fail
    resource.password(passwords);
    fail("Should never get here!");
}