Java SDK

How to add Java SDK to your application

1. Installing the Java-SDK package

HyperTest's Maven packages are hosted on a GitHub public Maven registry. To install and use HyperTest's java-sdk package in your application, follow these steps:

  1. Add Agent in pom.xml

    1. Define Properties in pom.xml file

  2. Add the HyperTest agent dependency to your project. You can check for the latest version on the HyperTest Java SDKarrow-up-right.

  3. Install HyperTest's Java SDK package

Add the following content to your pom.xml

chevron-rightpom.xmlhashtag
    <dependency>
        <groupId>co.hypertest</groupId>
        <artifactId>hypertest-agent-v3</artifactId>
        <version>0.0.7</version>
    </dependency>

We support multiple package managers

  1. Maven

  2. Gradle

  3. Bazel

To run with Maven

mvn clean install

To run with Gradle

To run with Bazel

2. Initialising SDK

2.1 Adding SDK in code

  • Initialise the HyperTest Java SDK in the public static void main method of your service. This must be the first thing in your main method.

  • <HT_SERVICE_ID> is the identifier that we created in the Adding your first service section

circle-exclamation

To enable hypertest, set the HT_MODE env variable RECORD and start your app

3. Run your application with Hypertest

  • JaCoCo agent is used for capturing code coverage of the application. Please use the following link to download the jar file. HYPERTEST-JACOCO-AGENTarrow-up-right

  • Please refer to the following page for instructions on integrating, building, and running the HyperTest-enabled JaCoCo agent with the HyperTest Java agent in your application.

How to integrate and run the HyperTest Java Agent with the JaCoCo agent in your Java applicationchevron-right

4. Verifying traffic is captured

Start sending HTTP requests on your app running with the hypertest SDK.

You should start seeing requests under the All requests section on the dashboard

Last updated