API automation demonstration · Independent work

Repeatable API contracts with Java and RestAssured

Ten isolated Java, RestAssured and JUnit checks covering authentication, contracts, errors and a deliberately invalid response.

A verified local test-report snapshot for the synthetic API demonstration.
A local synthetic test-run snapshot, not a client system or production audit.

Local verification snapshot · 2026-11-13

Synthetic API contract checks

Java · RestAssured · JUnit · Isolated loopback fixture

Tests
10
Failures
0
Errors
0
Skipped
0
  • passedunsupportedMethodsDoNotCreateAnOrder
  • passedhealthHasAnExplicitJsonContract
  • passedresponsesPreventAccidentalCachingOfProtectedData
  • passedaValidListKeepsTheDocumentedEnvelope
  • passedauthorizedOrderHasStableTypesAndValues
  • passedincorrectAuthenticationIsRejected
  • passedmissingAuthenticationIsRejected
  • passedinvalidPaginationIsRejected
  • passedcontractAssertionDetectsTheDeliberatelyInvalidFixture
  • passedmissingOrderHasAnActionableErrorWithoutAStackTrace

This snapshot is tied to the source hash in the downloadable report. It is not a guarantee about future runs or coverage of a real customer system.

Download verification snapshot (JSON)

The problem

A useful starter suite must do more than check HTTP 200. It should explain the expected contract, cover meaningful failure paths and prove that its assertions detect a bad response.

My contribution

An independently built, synthetic demonstration using Java, RestAssured and JUnit. It runs only against an isolated loopback fixture; no employer code, client application, credentials or customer data are used.

Implementation decisions

Keep each test isolated

Each test starts a new fixture on an ephemeral local port and stops it afterward. No external API availability or shared database is required.

Test contracts and negative paths

Check JSON types, authentication failures, missing records, pagination, unsupported methods and response-cache policy, not only happy-path status codes.

Prove the check can fail

A test deliberately changes a numeric total to a string and asserts that the contract assertion rejects it. This is an explicit fixture fault, not a claim about a production bug.

Source, reports and reproducible execution

JDK 17 or newer and Maven 3.9 or newer are sufficient. Run mvn -B -ntp verify from examples/api-automation. The first run downloads the pinned test dependencies. The README explains the test matrix, fixture and limits.

The result and its limits

The local verification snapshot records ten tests passing with no failures, errors or skipped tests. The source hash ties the snapshot to the checked example. CI produces fresh Surefire reports when the example changes.

Need a similar problem solved?

Project brief template
Hello Andrei,

Project type:
Brief description:
Required functionality:
Approximate budget (EUR):
Desired deadline:
Relevant links:

Please do not include passwords, API keys, payment details or confidential customer data.