I was working on one project and faced the following issue
I created a method in class to find some user and apply logic, it throws an exception if something unexpected is returned else user object either with id null or with some value
I wrote unit test for all test cases , now in callee i forgot to add condition for null id .
What is the best practise to handle these kind of error. Shall i write integration tests with all test cases Or integration test should have only happy path?
Secondly, in integration test, is it good to use embedded database instead of actual db? I was thinking to use embedded database for integration test, but how can i test the queries which are vendor specific, example rownum in oracle and limit in mysql. In my actual env we are using oracle and embedded database i can use h2. I am using plain jdbc
Thanks