Skip to main content
Version: 2.0.0

Keploy Integration with Junit


  1. Java 1.8+
  2. Maven
  3. Jacoco 0.8.8


Get Keploy java sdk

Download the latest release of the Keploy Java SDK at maven central and add keploy-sdk as a dependency to your pom.xml :

<version>1.0.0-SNAPSHOT</version> <!-- use latest release -->

Update pom.xml file

You will need to add the following puligns in pom.xml file of your application. :-

<!-- <skipTests>true</skipTests> -->
<!-- Prepare the JaCoCo agent to track coverage during tests -->
<!-- Merge execution data files after tests are run -->
<!-- Include all .exec files -->
<!-- Exclude the merged exec file -->
<!-- Output of merged data -->
<!-- Generate report based on the merged execution data -->
<!-- Use merged data file -->


For the code coverage for the keploy API tests using the junit integration, you need to add the following test to your Junit test file.

import io.keploy.Keploy; // import statement

public void testKeploy() throws IOException, InterruptedException {
String jarPath = "target/springbootapp-0.0.1-SNAPSHOT.jar";

Now let's run junit tests along keploy using command:-

sudo -E keploy test -c "mvn test" --delay 15 --coverage