0

My Jacoco code coverage check is failing for this reason:

[WARNING] Rule violated for method ie.aviva.digital.salesgenerator.service.SalesService.SalesService(): lines total count is 93, but expected maximum is 35

This is the default constructor. How do I exclude this from the check?

runnerpaul
  • 5,942
  • 8
  • 49
  • 118
  • [exclude-a-method-from-a-jacoco-code-coverage](https://stackoverflow.com/questions/47824761/how-would-i-add-an-annotation-to-exclude-a-method-from-a-jacoco-code-coverage-re) – Andrei Lisa Aug 28 '23 at 10:35
  • What is 93? Is that the number of lines in the class that are not covered, or the number of lines in the default constructor? If the latter, you should be writing tests for it, not excluding it from coverage. – David Conrad Aug 28 '23 at 14:40
  • 93 is the number of lines in the default constructor. I refactored my class to get rid of this. – runnerpaul Aug 29 '23 at 13:04

0 Answers0