1

I am using maven with cobertura plugin for my application. The test class what I have written is for controller and running fine without any issues in eclipse.There are so many dependencies on other classes.I am using mockito and powermockito both . When I run

mvn clean test

from command prompt it shows all the test cases that are passed.I have around 9 test cases, but when I run

mvn cobertura:cobertura

it shows only one test case run Tests run: 1, Failures: 0, Errors: 1 The error what it is showing is in different class[assume it as X class] which I have not modified but I am mocking this X class in my test class.

1)

Does cobertura depends on other classes also apart from main test class for code coverage? If so what I need to do .

2)

I am not using injectmocks in my test class instead I am using new operator to call the controller class.Since inject mocks was calling real methods I have not used this.

Any help would be appreciated

Pradeep
  • 1,947
  • 3
  • 22
  • 45

0 Answers0