Skip to content

Update the USPS proofing results job to respect the usps_mock_fallback flag#9007

Merged
NavaTim merged 4 commits intomainfrom
usps-api-mock
Aug 15, 2023
Merged

Update the USPS proofing results job to respect the usps_mock_fallback flag#9007
NavaTim merged 4 commits intomainfrom
usps-api-mock

Conversation

@NavaTim
Copy link
Contributor

@NavaTim NavaTim commented Aug 15, 2023

🛠 Summary of changes

📜 Testing Plan

Provide a checklist of steps to confirm the changes.

  • Set flag usps_mock_fallback to false
  • Configure USPS proofing client
    • usps_ipp_root_url
    • usps_ipp_username
    • usps_ipp_password
    • usps_ipp_sponsor_id
    • usps_ipp_client_id
  • Create enrollment record
    bundle exec rails dev:random_in_person_users NUM_USERS='1' SCRYPT_COST='800$8$1$' CREATE_PENDING_ENROLLMENT_IN_USPS=‘1’
  • Run job: GetUspsProofingResultsJob.perform_now(Time.zone.now)
  • Confirm that enrollment remains in pending status
  • Set flag usps_mock_fallback to true
  • Run job: GetUspsProofingResultsJob.perform_now(Time.zone.now)
  • Confirm that enrollment is updated to passed status

@NavaTim NavaTim requested review from a team, JackRyan1989 and racingspider and removed request for a team and JackRyan1989 August 15, 2023 19:07
Copy link
Contributor

@sheldon-b sheldon-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks for doing this

Comment on lines +63 to +69
@proofer ||= UspsInPersonProofing::Proofer.new
@proofer ||= begin
if IdentityConfig.store.usps_mock_fallback
UspsInPersonProofing::Mock::Proofer.new
else
UspsInPersonProofing::Proofer.new
end
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use EnrollmentHelper#usps_proofer here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, done.

@NavaTim NavaTim merged commit 1809908 into main Aug 15, 2023
@NavaTim NavaTim deleted the usps-api-mock branch August 15, 2023 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants