Hello Jacoco Experts,
i have a spring boot - micro service application for which i have written some BDD tests.
As a further research from my previous POC, i did the following steps to generate the jacoco report.
1. Added the below java agent in the vM options of the run/Debug configurations screen of my TestRunner class. refer the screen shot below:
-javaagent:C:\\Users\\U645789\\IdeaProjects\\jaragents\\org.jacoco.agent-0.8.2-runtime.jar=destfile=C:\\Users\\U645789\\IdeaProjects\\jaragents\\jacocoReward.exec,append=true

2. i started my spring boot application (micro service) using the boot run option.
3. Executed my BDD tests successfully and found the exec file has generated successfully.
4. Used the "show code coverage data" option of intellji to see the code coverage details and it shows all 0% for all sections. screen shot given below:

Tried with a simple java class (in the same project) and see if the code coverage was reported correctly. i could see that for the normal simple java class where the actual function if executed directly from my test files, the code coverage details are showing up correctly.
I am having a feeling that code coverage for my actual micro services are not reported due to the way the classes and methods are invoked when the test are executed.
i used the RestAssured library to invoke the micro service. a sample code will be something like this.
Response response = given().
contentType(ContentType.JSON).
body(requestBody).
headers(requestHeaders).
when().
post(resourceURI).
then().
extract().
response();
Any suggestions on what could be root cause will be really appreciated.
Thanks