---
# System prepended metadata

title: Check the Test Coverage

---

# Check the Test Coverage
###### tags: `Toshiba Global Commerce Solutions`

1. Go to `pom.xml` of the folder and add the following code to it.
```
<executions>
  <execution>
    <goals>
      <goal>prepare-agent</goal>
    </goals>
  </execution>
  <execution>
    <id>report</id>
    <phase>test</phase>
    <goals>
      <goal>report</goal>
    </goals>
  </execution>
</executions>
```

The following screenshot is an example of the pom.xml in the folder of `tgcp-pricelists-datastore-mongo`
![pom.xml](https://hackmd.io/_uploads/HkCP5BaGp.png)





2. Install required packages to run the test
`mvn clean install -Ppull-request,code-coverage`
3. If the testing goes well, we go see the result by selecting:
**Run** -> **Show Coverage Data** -> + -> **YOUR_FOLDER** (example here is `tgcp-pricelists-datastore-mongo`) -> **target** -> **coverage-reports** -> **jacoco-ut.exec** -> **OK**
![jacoco-ut.exec](https://hackmd.io/_uploads/HJfCqSpMa.png)






3. Choose **Show Selected** button and you can see the report window will pop up on the right side in IntelliJ:

![](https://hackmd.io/_uploads/rkkxjB6z6.png)

If you would like to see the detail result, you can select **Generate Coverage Report** button and click **Save** button:
![generate coverage report](https://hackmd.io/_uploads/HJwfsH6zT.png)




4. Consequently, you can see the html report by accessing the `/htmlReport`

![html reulst](https://hackmd.io/_uploads/B1DfhHTMT.png)
