0

I have code set up in which there are different projects - like multi module Maven projects.

We are setting up the sonar reports and code coverage reports.

So to start with, we have written the test cases for various layers - like Business layer, common layer, Batch layer, Services Layer, Data layer.

Data layer - is the module where we do all the database operations - like look up, save, persist, update and merge.

I have searched a lot - but there are no subtle discussion around these topics.

Is it ok to write test cases for save/update/persist methods - whether it be mock or by calling real methods ..?

Any comments are welcome, thank you in advance...

Richardissimo
  • 5,596
  • 2
  • 18
  • 36
Ashish Shetkar
  • 1,414
  • 2
  • 18
  • 35
  • 1
    *"is it ok to write test cases for...methods"* Yes. If you are asking whether to test the data layer by mocking the database, or by integration testing, search for "mock database" on the internet, then search again after adding the word "bad". – Richardissimo Mar 19 '19 at 06:25
  • @Richardissimo thanks - i could get some blogs around – Ashish Shetkar Mar 19 '19 at 07:20

0 Answers0