@Test
public void testActivateUser_Throws_PhrPatientNotFoundException() throws Exception {

    // Arrange
    final Long patientId = 10L;
    final UserActivationRequestDtoForTest request = new UserActivationRequestDtoForTest();
    final UserActivationResponseDto response = new UserActivationResponseDto();
    final String email = "email";
    final String username = "email";
    final String verificationCode = "verificationCode";
    final int year = 2010;
    final int month = 2;
    final int day = 3;
    final LocalDate birthDate = LocalDate.of(year, month, day);
    final String firstName = "firstName";
    final String lastName = "lastName";
    final String genderCode = "genderCode ";
    final String emailToken = "emailToken";
    final String password = "Password#1";
    final String confirmPassword = "Password#1";
    final boolean verified = true;
    response.setEmail(email);
    response.setBirthDate(birthDate);
    response.setFirstName(firstName);
    response.setLastName(lastName);
    response.setId(patientId);
    response.setGenderCode(genderCode);
    response.setBirthDate(birthDate);
    response.setGenderCode(genderCode);
    response.setVerified(verified);
    request.setVerificationCode(verificationCode);
    request.setBirthDate(Arrays.asList(year, month, day));
    request.setEmailToken(emailToken);
    request.setPassword(password);
    request.setConfirmPassword(confirmPassword);
    request.setUsername(username);
    when(userCreationService.activateUser(argThat(matching(
            req -> req.getBirthDate().equals(birthDate) &&
                    req.getVerificationCode().equals(verificationCode) &&
                    req.getEmailToken().equals(emailToken) &&
                    req.getPassword().equals(password)
    )), xForwardedProto, xForwardedHost, xForwardedPort)).thenThrow(PhrPatientNotFoundException.class);
    // Act and Assert
    mvc.perform(post("/activations")
            .contentType(MediaType.APPLICATION_JSON_UTF8)
            .content(objectMapper.writeValueAsBytes(request))
            .header(UserCreationController.X_FORWARDED_PROTO, xForwardedProto)
            .header(UserCreationController.X_FORWARDED_HOST, xForwardedHost)
            .header(UserCreationController.X_FORWARDED_PORT, xForwardedPort))
            .andExpect(status().isNotFound());
}