SOLUTIONS · API TESTING

Test the API. Not the mock.

A mocked contract can pass while the real endpoint fails. Jetic tests the running API: actual middleware, actual tokens, actual responses, ordered the way a client would call them.

Real serverContract checksNegative pathsEvidence
orders-workflow.json
1. login 200 token captured
2. create order 201 id captured
3. fetch order 200 schema valid
4. pay with bad card 402 expected
5. retry with valid 200 idempotent
✔ 5 passed · 2 captures · trace saved
Happy path and negative path in one workflow

WHAT GETS TESTED

The parts a unit test cannot reach.

Jetic is aimed at the boundary between your code and the client.

01HTTP

Status codes

Each step declares what success looks like, including expected failures.

02Schema

Response shape

Validate the payload against the contract before moving on.

03Auth

Auth flow

Use the real token producer and inject it into protected calls.

04CRUD

State changes

Create, read, update, and delete in the order a client would.

05Edges

Validation errors

Assert the exact failure for bad input and missing fields.

06Model

Middleware order

The model records the chain, so the test runs against the same guards.

TEST LAYERS

Different questions, different tools.

Jetic does not replace unit tests. It covers the questions that only exist over HTTP.

LayerQuestionJetic
UnitDoes this function behave?Out of scope
IntegrationDo these modules compose?Partly, through the real server
API contractDoes the endpoint keep its promise?Yes, per step
JourneyDoes the sequence work with real state?Yes, with capture and inject
RegressionDid this change break a known path?Yes, on every run

NEGATIVE PATHS

A passing suite should include the failures.

The most valuable tests often assert that the API says no for the right reason. Jetic treats an expected error as a normal step outcome.

  • Assert 401 for a missing token
  • Assert 403 for the wrong owner
  • Assert 422 for an invalid body
  • Continue the journey after an expected failure
expect-status
step 4 POST /api/orders/42/pay
body { "card": "declined" }
expect 402 Payment Required
actual 402 · body.code = card_declined
capture errorCode ← body.code
✔ negative path passed

HOW A RUN WORKS

Order, state, assertion, evidence.

01

Order

The workflow fixes the sequence of calls.

steps[]
02

State

Capture a value and inject it downstream.

capture / inject
03

Assert

Declare the expected status for each step.

expectStatus
04

Trace

Keep the request, response, and timing.

.jetic/runs/

KEEP GOING

Testing is one part of the loop.

API TESTING FAQ

Frequently asked questions

Do I need a running server?

Yes. Simulations send real HTTP requests to the environment you select. Scanning does not need the server.

Can I test error responses?

Yes. Expected status is part of a step, and conditions can assert on captured error codes.

Does Jetic mock external services?

No. It tests your API as it runs. External dependencies need to be available in the target environment.

Can I keep tests next to the code?

Yes. The .jetic folder lives in the repository and can be reviewed with the change that affects it.

Test what runs. Keep what happened.

Write the journey once, run it against the real API, and keep the trace when it fails.

Try a simulation