BindResponse bindResponse = userConnection.bind( bindRequest );
assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
assertEquals( PasswordPolicyErrorEnum.CHANGE_AFTER_RESET,
getPwdRespCtrl( bindResponse ).getResponse().getPasswordPolicyError() );
ModifyRequest modifyRequest = new ModifyRequestImpl();
modifyRequest.setName( userDn );
modifyRequest.replace( "userPassword", "123456" );
modifyRequest.addControl( PP_REQ_CTRL );
// succeed because admin previously set password
ModifyResponse modifyResponse = userConnection.modify( modifyRequest );
assertEquals( ResultCodeEnum.SUCCESS, modifyResponse.getLdapResult().getResultCode() );
modifyRequest = new ModifyRequestImpl();
modifyRequest.setName( userDn );
modifyRequest.replace( "userPassword", "1234567" );
modifyRequest.addControl( PP_REQ_CTRL );
// fail cause password is too young
modifyResponse = userConnection.modify( modifyRequest );
assertEquals( ResultCodeEnum.CONSTRAINT_VIOLATION,
modifyResponse.getLdapResult().getResultCode() );
assertEquals( PasswordPolicyErrorEnum.PASSWORD_TOO_YOUNG,