Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

restassured-testing

БесплатноБез исполняемых скриптовНе проверен

Use whenever Java/JVM API tests need writing or fixing: loose assertions that let an empty 200 pass, slow sequential suites, or hand-rolled HTTP clients…

testlandот testland★ 18 звёзд на GitHub

Об этом скилле

restassured-testing

Overview

REST Assured is a Java DSL for HTTP API testing with a BDD-style given().when().then() chain (restassured-readme). It runs inside any JUnit / TestNG suite and consumes JSON, XML, and other content types via path expressions backed by Hamcrest matchers (restassured-usage).

This is the JVM-native counterpart to postman-collections. Use REST Assured when the team's primary stack is Java / Kotlin / Scala and type-safe authoring + same-language refactoring matter.

When to use

  • The project is a Maven or Gradle Java project.
  • The team wants API tests in the same language as the application (refactor-safe, IDE-aware).
  • Tests need to compose fluently with JUnit 5 / TestNG fixtures.
  • Authentication patterns required: Basic (preemptive), OAuth2 (bearer token), API key in header - all first-class.

If the team is non-JVM, evaluate postman-collections (JSON-driven), tavern-testing (Python YAML), or karate-testing (cross-platform DSL).

Install

REST Assured 6.3.0 (2026-10-23) is current; per the changelog, 6.0.0 set the "New minimum Java baseline" to 17.

Maven

<dependency>
    <groupId>io.rest-assured</groupId>
    <artifactId>rest-assured</artifactId>
    <version>6.3.0</version>
    <scope>test</scope>
</dependency>
<!-- Optional: body(matchesJsonSchemaInClasspath(..)) -->
<dependency>
    <groupId>io.rest-assured</groupId>
    <artifactId>json-schema-validator</artifactId>
    <version>6.3.0</version>
    <scope>test</scope>
</dependency>

(Per restassured-usage.) Keep every io.rest-assured module on the same version: with two or more modules, import io.rest-assured:rest-assured-bom in dependencyManagement instead of repeating the version. Spring Boot's dependency management can pin an older REST Assured; set the rest-assured.version property to override it.

Gradle

testImplementation(platform("io.rest-assured:rest-assured-bom:6.3.0"))
testImplementation("io.rest-assured:rest-assured")
testImplementation("io.rest-assured:json-schema-validator")

Upgrading from 5.x

Per the changelog:

  • 6.0.0 raises the baselines to Java 17 and Groovy 5.x and adds Jackson 3 object mapping.
  • 6.2.0 changes specification behavior. A spec from RequestSpecBuilder.build() can no longer send a request itself (spec.when().get(..) throws IllegalStateException; use given(spec)), and per usage, merging a spec "only overwrites values that the merged specification sets itself" where "Before REST Assured 6.2.0 values such as the base URI, port and authentication were reset by a merge". Re-run suites that layer several specs.
  • 6.3.0 adds an OpenRewrite recipe, io.restassured.MigrateRestAssured6Deprecations, in the rest-assured-openrewrite module, that moves code off APIs deprecated in 6.x. It also publishes json-path-gpath and xml-path-gpath, the REST Assured 7.0.0 names of json-path and xml-path; switch explicit json-path dependencies to them before 7.0.

Authoring

Imports

The canonical static imports for fluent authoring (restassured-usage):

import static io.restassured.RestAssured.*;
import static org.hamcrest.Matchers.*;
import static io.restassured.matcher.RestAssuredMatchers.*;

These bring given(), get(), post(), etc. plus Hamcrest matchers (equalTo, hasItems, containsString, nullValue, etc.) into scope.

given() / when() / then() chain

The basic shape (restassured-readme):

given().
    param("key1", "value1").
when().
    post("/somewhere").
then().
    body(containsString("OK"));

given() configures the request (params, headers, body, auth); when() issues the HTTP verb; then() asserts the response.

Status code assertion

get("/x").then().assertThat().statusCode(200);

(Per restassured-usage.)

statusCode(int) is equivalent to statusCode(equalTo(int)). For ranges, use statusCode(allOf(greaterThanOrEqualTo(200), lessThan(300))).

JSON path assertions

get("/lotto").then().body("lotto.lottoId", equalTo(5));
get("/lotto").then().body("lotto.winners.winnerId", hasItems(23, 54));

(Per restassured-usage.)

The first argument is a Groovy-style JSON path (models[0].author.name); the second is a Hamcrest matcher.

XML path assertions

given().parameters("firstName", "John", "lastName", "Doe").
when().post("/greetXML").
then().body("greeting.firstName", equalTo("John"));

(Per restassured-usage.)

Reuse request and response specifications

Per usage (Specification Re-use), build shared setup once with RequestSpecBuilder and shared expectations

Полный SKILL.md на GitHub

Установить restassured-testing в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

.tessl-plugin/plugin.jsonevals/api-suite-too-slow-serial/criteria.jsonevals/api-suite-too-slow-serial/task.mdevals/base-uri-pinned-to-localhost/criteria.jsonevals/base-uri-pinned-to-localhost/task.mdevals/basic-auth-double-round-trip/criteria.jsonevals/basic-auth-double-round-trip/task.mdevals/ci-run-hides-failure-detail/criteria.jsonevals/ci-run-hides-failure-detail/task.mdevals/contract-drift-slips-past-field-checks/criteria.jsonevals/contract-drift-slips-past-field-checks/task.mdevals/green-suite-missed-empty-payload/criteria.jsonevals/green-suite-missed-empty-payload/task.mdevals/handrolled-http-client-harness/criteria.jsonevals/handrolled-http-client-harness/task.mdevals/integration-tests-fire-during-unit-phase/criteria.jsonevals/integration-tests-fire-during-unit-phase/task.mdevals/legacy-xml-endpoint-substring-checks/criteria.jsonevals/legacy-xml-endpoint-substring-checks/task.mdevals/whole-body-string-comparison/criteria.jsonevals/whole-body-string-comparison/task.md

FAQ

Что делает скилл restassured-testing?

Use whenever Java/JVM API tests need writing or fixing: loose assertions that let an empty 200 pass, slow sequential suites, or hand-rolled HTTP clients. Writes REST Assured given/when/then tests: status, JSON and XML path checks, auth, reusable specs, schema checks, Maven or Gradle and CI reports.

Как установить скилл restassured-testing?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл restassured-testing запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить restassured-testing с