NdsBeisEsb/src/test/java/com/northgateps/nds/beis/esb/passwordreset/BeisPasswordResetRouteTest.java
//test passwordReset for unknown /invalid username

test passwordReset for unknown /invalid username
test passwordReset for unknown / invalid username
@Test
    public void testPasswordResetUnknownUser() throws Exception {
        logger.info("Checking that password reset is not initiated when username is unknown");
        MockNdsDirectoryKernel mockDirectoryKernel = new MockNdsDirectoryKernel();
        final BeisRegistrationDetails registeredUser = registerANewUser(mockDirectoryKernel);
        String username = registeredUser.getUserDetails().getUsername();
        MockEndpoint requestMock = getMockEndpoint(MOCK_PASSWORD_RESET_REQUEST_CHECK);
        requestMock.reset();
        requestMock.expectedMessageCount(0);
        MockEndpoint passwordResetResponseMock = getMockEndpoint(MOCK_PASSWORD_RESET_RESPONSE_CHECK);
        passwordResetResponseMock.reset();
        passwordResetResponseMock.expectedMessageCount(0);
        String resetCode = generateResetCode(username);
        PasswordResetNdsResponse userError = (PasswordResetNdsResponse) apiEndpoint.requestBody(
                createResetPasswordNdsRequestWithResetCode("a" + username, resetCode));
        assertFalse(userError.isSuccess());
        assertEquals("Check if it contains invalid message",
                "Username or activation code is invalid.",
                userError.getNdsMessages().getViolations().get(0).getMessage());
    }
@ Test public void testPasswordResetUnknownUser ( ) throws Exception { logger . info ( "Checking that password reset is not initiated when username is unknown" ) ; MockNdsDirectoryKernel mockDirectoryKernel = new MockNdsDirectoryKernel ( ) ; final BeisRegistrationDetails registeredUser = registerANewUser ( mockDirectoryKernel ) ; String username = registeredUser . getUserDetails ( ) . getUsername ( ) ; MockEndpoint requestMock = getMockEndpoint ( MOCK_PASSWORD_RESET_REQUEST_CHECK ) ; requestMock . reset ( ) ; requestMock . expectedMessageCount ( 0 ) ; MockEndpoint passwordResetResponseMock = getMockEndpoint ( MOCK_PASSWORD_RESET_RESPONSE_CHECK ) ; passwordResetResponseMock . reset ( ) ; passwordResetResponseMock . expectedMessageCount ( 0 ) ; String resetCode = generateResetCode ( username ) ; PasswordResetNdsResponse userError = ( PasswordResetNdsResponse ) apiEndpoint . requestBody ( createResetPasswordNdsRequestWithResetCode ( "a" + username , resetCode ) ) ; assertFalse ( userError . isSuccess ( ) ) ; assertEquals ( "Check if it contains invalid message" , "Username or activation code is invalid." , userError . getNdsMessages ( ) . getViolations ( ) . get ( 0 ) . getMessage ( ) ) ; }
test passwordReset for unknown /invalid username
test passwordReset for unknown / invalid username
// Ensure email request data is not present
