Quickstart

java

Run the following command in your terminal to generate an integration test:

skyramp generate integration rest https://demoshop.skyramp.dev/api/v1/products \
--language java \
--framework junit \
--api-schema

Upon completion, Skyramp creates a Java test file (ProductsIntegrationTest.java) that can be compiled and run immediately. The content of the generated test is explained here.

Explanation of Command

  • https://demoshop.skyramp.dev/api/v1/products: Defines the URL to the endpoint we aim to test.

  • --language: Specifies the test output language. We currently support Python, Java, and TypeScript.

  • --framework: Specify the test execution framework of choice.

  • --api-schema: Points to the OpenAPI schema used to generate the test. We also support sample data and traces as inputs for test generation.

Execute your Test

You can execute the generated tests without any additional adjustments to the code. However, based on the application you want to test, you can pass your authentication token to Skyramp Tests via an environment variable.

Set environment variable for authentication

To test against an application that requires authentication, pass your token using our environment variable. By default, Skyramp expects a Bearer Token but we support additional authentication methods (Example 3). If your API does not require any authentication, you can skip this step and just run the test.

Skyramp’s sample application requires a session identifier. Quickly obtain your session_id via the Demo Shop UI and set it as your authentication header. Additional information and ways to obtain the session_id can be found here.

export SKYRAMP_TEST_TOKEN=$your_auth_token

Run the test

Compile and run the generated tests.

Please ensure that you have installed our Java library and the required JUnit dependencies from the Installation Guide. If everything was successfully installed, you should see a lib folder in your working directory containing a minimum of 3 JAR files.

Compile your test

Compile the generated test case. The compiled file ProductsIntegrationTest.class will be saved in the /target folder.

javac -cp "./lib/*" -d

Execute your test

Execute the generated test case using the JUnit platform console. Make sure your JUNIT_PLATFORM_VER matches the version of the JAR file you originally installed.

JUNIT_PLATFORM_VER="1.9.3"
classpath="target:$(echo ./lib/*.jar | tr ' ' ':')"
java -jar "./lib/junit-platform-console-standalone-${JUNIT_PLATFORM_VER}.jar" \
    --classpath "$classpath" \
    --include-engine=junit-jupiter \
    --select-class=ProductsIntegrationTest \
    --reports-dir

The above command works as follows (refer to the JUnit documentation for more information):

  • --classpath: Specifies the location of compiled test classes and dependencies.

  • --include-engine: Selects the JUnit Jupiter test engine for test discovery and execution.

  • --select-class: Executes the specified test class.

  • --reports-dir: Generates test reports (usually XML) in the specified directory. 

Your integration test will perform the following sequence of actions:

  • Creation: Adds a new product to the Demo Shop.

  • Retrieval: Confirms the product has been successfully added.

  • Update: Modifies details of the created product.

  • Deletion: Deletes the created and modified product.

The test automatically identifies the relevant path parameters, intelligently chains the different requests together, and executes the test against the specified URL.

Review Test Results

By default, JUnit provides clear and concise output indicating the success or failure of each step executed:

  • Each executed test will be displayed clearly in the terminal.

  • All encountered errors or issues will be summarized for easy debugging at the end.

You can adjust the output behavior following this documentation.

Next Steps

Congratulations on generating and executing your first Skyramp test! To learn more about the generated test and understand customization options, please visit the Integration Test Documentation.

Let’s automate testing together!

Related topics

Run the following command in your terminal to generate an integration test:

skyramp generate integration rest https://demoshop.skyramp.dev/api/v1/products \
--language java \
--framework junit \
--api-schema

Upon completion, Skyramp creates a Java test file (ProductsIntegrationTest.java) that can be compiled and run immediately. The content of the generated test is explained here.

Explanation of Command

  • https://demoshop.skyramp.dev/api/v1/products: Defines the URL to the endpoint we aim to test.

  • --language: Specifies the test output language. We currently support Python, Java, and TypeScript.

  • --framework: Specify the test execution framework of choice.

  • --api-schema: Points to the OpenAPI schema used to generate the test. We also support sample data and traces as inputs for test generation.

Execute your Test

You can execute the generated tests without any additional adjustments to the code. However, based on the application you want to test, you can pass your authentication token to Skyramp Tests via an environment variable.

Set environment variable for authentication

To test against an application that requires authentication, pass your token using our environment variable. By default, Skyramp expects a Bearer Token but we support additional authentication methods (Example 3). If your API does not require any authentication, you can skip this step and just run the test.

Skyramp’s sample application requires a session identifier. Quickly obtain your session_id via the Demo Shop UI and set it as your authentication header. Additional information and ways to obtain the session_id can be found here.

export SKYRAMP_TEST_TOKEN=$your_auth_token

Run the test

Compile and run the generated tests.

Please ensure that you have installed our Java library and the required JUnit dependencies from the Installation Guide. If everything was successfully installed, you should see a lib folder in your working directory containing a minimum of 3 JAR files.

Compile your test

Compile the generated test case. The compiled file ProductsIntegrationTest.class will be saved in the /target folder.

javac -cp "./lib/*" -d

Execute your test

Execute the generated test case using the JUnit platform console. Make sure your JUNIT_PLATFORM_VER matches the version of the JAR file you originally installed.

JUNIT_PLATFORM_VER="1.9.3"
classpath="target:$(echo ./lib/*.jar | tr ' ' ':')"
java -jar "./lib/junit-platform-console-standalone-${JUNIT_PLATFORM_VER}.jar" \
    --classpath "$classpath" \
    --include-engine=junit-jupiter \
    --select-class=ProductsIntegrationTest \
    --reports-dir

The above command works as follows (refer to the JUnit documentation for more information):

  • --classpath: Specifies the location of compiled test classes and dependencies.

  • --include-engine: Selects the JUnit Jupiter test engine for test discovery and execution.

  • --select-class: Executes the specified test class.

  • --reports-dir: Generates test reports (usually XML) in the specified directory. 

Your integration test will perform the following sequence of actions:

  • Creation: Adds a new product to the Demo Shop.

  • Retrieval: Confirms the product has been successfully added.

  • Update: Modifies details of the created product.

  • Deletion: Deletes the created and modified product.

The test automatically identifies the relevant path parameters, intelligently chains the different requests together, and executes the test against the specified URL.

Review Test Results

By default, JUnit provides clear and concise output indicating the success or failure of each step executed:

  • Each executed test will be displayed clearly in the terminal.

  • All encountered errors or issues will be summarized for easy debugging at the end.

You can adjust the output behavior following this documentation.

Next Steps

Congratulations on generating and executing your first Skyramp test! To learn more about the generated test and understand customization options, please visit the Integration Test Documentation.

Let’s automate testing together!

Related topics

Run the following command in your terminal to generate an integration test:

skyramp generate integration rest https://demoshop.skyramp.dev/api/v1/products \
--language java \
--framework junit \
--api-schema

Upon completion, Skyramp creates a Java test file (ProductsIntegrationTest.java) that can be compiled and run immediately. The content of the generated test is explained here.

Explanation of Command

  • https://demoshop.skyramp.dev/api/v1/products: Defines the URL to the endpoint we aim to test.

  • --language: Specifies the test output language. We currently support Python, Java, and TypeScript.

  • --framework: Specify the test execution framework of choice.

  • --api-schema: Points to the OpenAPI schema used to generate the test. We also support sample data and traces as inputs for test generation.

Execute your Test

You can execute the generated tests without any additional adjustments to the code. However, based on the application you want to test, you can pass your authentication token to Skyramp Tests via an environment variable.

Set environment variable for authentication

To test against an application that requires authentication, pass your token using our environment variable. By default, Skyramp expects a Bearer Token but we support additional authentication methods (Example 3). If your API does not require any authentication, you can skip this step and just run the test.

Skyramp’s sample application requires a session identifier. Quickly obtain your session_id via the Demo Shop UI and set it as your authentication header. Additional information and ways to obtain the session_id can be found here.

export SKYRAMP_TEST_TOKEN=$your_auth_token

Run the test

Compile and run the generated tests.

Please ensure that you have installed our Java library and the required JUnit dependencies from the Installation Guide. If everything was successfully installed, you should see a lib folder in your working directory containing a minimum of 3 JAR files.

Compile your test

Compile the generated test case. The compiled file ProductsIntegrationTest.class will be saved in the /target folder.

javac -cp "./lib/*" -d

Execute your test

Execute the generated test case using the JUnit platform console. Make sure your JUNIT_PLATFORM_VER matches the version of the JAR file you originally installed.

JUNIT_PLATFORM_VER="1.9.3"
classpath="target:$(echo ./lib/*.jar | tr ' ' ':')"
java -jar "./lib/junit-platform-console-standalone-${JUNIT_PLATFORM_VER}.jar" \
    --classpath "$classpath" \
    --include-engine=junit-jupiter \
    --select-class=ProductsIntegrationTest \
    --reports-dir

The above command works as follows (refer to the JUnit documentation for more information):

  • --classpath: Specifies the location of compiled test classes and dependencies.

  • --include-engine: Selects the JUnit Jupiter test engine for test discovery and execution.

  • --select-class: Executes the specified test class.

  • --reports-dir: Generates test reports (usually XML) in the specified directory. 

Your integration test will perform the following sequence of actions:

  • Creation: Adds a new product to the Demo Shop.

  • Retrieval: Confirms the product has been successfully added.

  • Update: Modifies details of the created product.

  • Deletion: Deletes the created and modified product.

The test automatically identifies the relevant path parameters, intelligently chains the different requests together, and executes the test against the specified URL.

Review Test Results

By default, JUnit provides clear and concise output indicating the success or failure of each step executed:

  • Each executed test will be displayed clearly in the terminal.

  • All encountered errors or issues will be summarized for easy debugging at the end.

You can adjust the output behavior following this documentation.

Next Steps

Congratulations on generating and executing your first Skyramp test! To learn more about the generated test and understand customization options, please visit the Integration Test Documentation.

Let’s automate testing together!

Related topics

© 2025 Skyramp, Inc. All rights reserved.

© 2025 Skyramp, Inc. All rights reserved.

© 2025 Skyramp, Inc. All rights reserved.