Skip to content

Getting Started

Prerequisites

  • GraalVM Java 25 — the project requires Java 25. Install it using sdkman:
    sdk install java 25-graalce
    sdk use java 25-graalce
    
  • Maven Wrapper — included in the repository; no separate Maven installation required

Installation

Clone the repository and build:

git clone https://github.com/snytkine/api-tester-cli.git
cd api-tester-cli

# JVM build (recommended for development — fast, instant startup after build)
./mvnw clean package

# GraalVM native binary (optional — start instantly, no JVM overhead)
./mvnw -Pnative native:compile

The JVM build produces a JAR in target/ that runs with java -jar. The native build produces a standalone executable in target/.

Running your first test suite

Create a simple test suite file, example.yml:

name: "My First Test Suite"
tests:
- name: "Verify API is responding"
  request:
    method: "GET"
    url: "https://httpbin.org/status/200"
  assertions:
  - type: "status_code"
    expected: 200

Run it:

# Using the JAR
java -jar target/api-tester-cli-0.0.1-SNAPSHOT.jar run-suite --suite=$(pwd)/example.yml

# Or use the alias
rs --suite=$(pwd)/example.yml

You'll see the interactive terminal UI with real-time progress. Tests are shown with pass/fail indicators.

Output modes

The tool automatically detects your environment and chooses an output mode:

Interactive UI (default on TTY)

When running in a terminal, the tool displays an interactive grid showing test progress in real time, with color-coded results (✓ for passed, ✗ for failed).

Disable with --no-ui to force JSON output:

rs --suite=example.yml --no-ui

JSON output (CI-friendly)

The JSON output is suitable for parsing in CI/CD pipelines and includes detailed assertion failure information. Force it with --no-ui or run on a non-TTY:

rs --suite=example.yml --no-ui > results.json

Force UI on non-TTY

To enable the interactive UI even when stdout doesn't look like a terminal:

rs --suite=example.yml --ui

Next steps: