LG-10983: use mock client to generate http status error response#9244
LG-10983: use mock client to generate http status error response#9244dawei-nava merged 4 commits intomainfrom
Conversation
a64f90d to
26c47db
Compare
charleyf
left a comment
There was a problem hiding this comment.
I don't fully understand the why of this PR, but approving b/c it's entirely mocks and I think I'm hitting the limits of my own knowledge.
| @@ -7,7 +7,8 @@ | |||
| expect( | |||
There was a problem hiding this comment.
I'm not sure about this, the test name doesn't seem to match what you're testing anymore.
| end | ||
|
|
||
| describe 'generate response for failure indicating http status' do | ||
| it 'generate network error response for status 500 when post image' do |
There was a problem hiding this comment.
When check out this branch and try the yml files as described in the PR testing plan, I don't see the errors I'd expect. Instead of the technical difficulties message, I see:
440: Your image size is too large or too small. Please add images of your ID that are about 2025 x 1275 pixels.
438: The image file that you added is not supported. Please take new photos of your ID and try again.
500: Try taking new pictures.
Maybe I'm misunderstanding and this is expected, but I thought I'd see the network_error of We are having technical difficulties on our end. Please try to submit your images again later.
There was a problem hiding this comment.
Hmm looking again at your test though, maybe I'm wrong and this is expected, as in line 221 of this file.
🎫 Ticket
LG-10983
🛠 Summary of changes
The original mock client always generate error from the last http call( of the 3 http call conversation with Acuant AssureID), it's expecting a http response of 2xx in most cases.
This change allows to return non 2xx response at any step of the 3 http calls. Namely 440, 438, 439 for some image metric issue during post front/back image phase, in addition to 5xx for these phases.
Also can trigger 5xx at the last step(get result) as needed, though 4xx codes seems not used according to API documentation.
📜 Testing Plan
Provide a checklist of steps to confirm the changes.
Front side 440 error
Back side 438 error
Get result 500 error