How to measure Code Coverage of a RestFul API
<p>I have a maven based multi-module Jersey project which exposes few RestFul API. Project Structure is like - </p>

<p>Project </p>

<ul>
<li><p>Module1</p>

<p>----------src</p>

<p>--------- unit test</p></li>
<li><p>Module2</p>

<p>----------src</p>

<p>--------- unit test</p></li>
<li><p>Module3</p>

<p>----------src</p>

<p>--------- unit test</p></li>
<li><p>ModuleN - <strong>this module contains Integration Tests which will hit endpoints exposed by project and test the whole service like a black box</strong></p>

<p>----------src</p>

<p>--------- unit test</p></li>
</ul>

<p>I want to build this project and execute unit tests in during build phase then create a jar, deploy this jar somewhere, execute integration tests (which is present in one module of project and this will hit the REST end points) then I wanted to measure combine coverage (unit+integration tests).</p>

<p>I have gone though a lot of blogs and articles but everywhere we have half information. can someone point me or guide me how can I do it.</p>

<p>Thanks
-Shahid</p>