Hi Kush,
sure JaCoCo can collect execution data for any Java application.
To collect coverage data of a specific “hit” you have to execute the processing in isolation. As JaCoCo collects execution data of all executed code, you can not run this test while the server serves other requests too.
The steps are as always:
1) Run the server with the JaCoCo agent attached
2) Execute some test (e.g. exercise the endpoints)
3) Shut down the server properly to get the execution data file
4) Create coverage report
Alternatively JaCoCo agent supports a remote control protocol: This allows to collect and reset execution data without shutdown. So you can select separate coverage data for each request.