IBX-10894: Moved throw error when invitation not found in database to gateway - #136
Conversation
bnowak
left a comment
There was a problem hiding this comment.
It's good you added coverage for InvitationService, however it's not the direct gateway layer you touched 😅
I'd recommend adding separate test coverage for gateway too 😉
|
@bnowak I thought about it, and I had tests for Gateway ready, but I'm wondering whether it wouldn't be better to add tests for InvitationService, which are missing, and at the same time also test the gateway - in fact, the tests for the gateway will be a copy of this one |
It's always better to test each layer separately.
That's kind of true, but on the gateway layer we don't have mapping to anyway, any tests are better than none :) |
|
@bnowak I added DoctrineGatewayTest |
84d1cd0 to
db99b09
Compare
|



Description:
Moved the NotFoundException handling from the handler layer to the Doctrine gateway. The getInvitation() method is always defined to return TInvitationData:
Previously, the gateway directly returned the result of fetchAssociative(). Since fetchAssociative() returns false when no matching record is found, this could violate the method's return contract and result in an error when no invitation existed.
I moved the check to the Doctrine gateway. This ensures that getInvitation() either returns a valid invitation record or throws a dedicated NotFoundException, so the method consistently fulfills its declared return type and the handler no longer needs to handle this case itself.
For QA:
Documentation: