Skip to content

Commit

Permalink
Include jurisdiction_in_maintenance_window in result when AAMVA raise…
Browse files Browse the repository at this point in the history
…s exception (#11700)

* add failing spec

* add jurisdiction_in_maintenance_window attribute when exception is raised

changelog: Bug Fixes, Logging, Include jurisdiction_in_maintenance_window in result when AAMVA raises exception

* use state_id_jurisdiction rather than state
  • Loading branch information
mitchellhenke authored Jan 3, 2025
1 parent 2f476bb commit 40423d7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/services/proofing/aamva/proofer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,14 @@ def proof(applicant)
applicant: aamva_applicant,
)

build_result_from_response(response, applicant[:state])
build_result_from_response(response, applicant[:state_id_jurisdiction])
rescue => exception
failed_result = Proofing::StateIdResult.new(
success: false, errors: {}, exception: exception, vendor_name: 'aamva:state_id',
transaction_id: nil, verified_attributes: []
transaction_id: nil, verified_attributes: [],
jurisdiction_in_maintenance_window: jurisdiction_in_maintenance_window?(
applicant[:state_id_jurisdiction],
)
)
send_to_new_relic(failed_result)
failed_result
Expand Down
12 changes: 12 additions & 0 deletions spec/services/proofing/aamva/proofer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,18 @@ def self.test_not_successful
expect(result.mva_timeout?).to eq(true)
expect(result.mva_exception?).to eq(true)
end

context 'when the DMV is in a defined maintenance window' do
before do
expect(Idv::AamvaStateMaintenanceWindow).to receive(:in_maintenance_window?)
.and_return(true)
end

it 'sets jurisdiction_in_maintenance_window to true' do
result = subject.proof(state_id_data)
expect(result.jurisdiction_in_maintenance_window?).to eq(true)
end
end
end
end

Expand Down

0 comments on commit 40423d7

Please sign in to comment.