Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

rest-assured

> 编程语言
Open source

Java DSL for easy testing of REST services

7.1K stars0 likes5 views
WebsiteGitHub

About

Java DSL for easy testing of REST services

Testing and validation of REST services in Java is harder than in dynamic languages such as Ruby and Groovy. REST Assured brings the simplicity of using these languages into the Java domain.

News

  • 2026-07-10: REST Assured 6.0.1 is released. The Spring modules now target Spring 7 and no longer pull their own Spring version onto your classpath, so they work on Spring Boot 4 without manual exclusions. It also rounds out Jackson 3 support and fixes a few bugs. See change log for more details.
  • 2026-01-16: REST Assured 5.5.7 is released with backported support for Spring framework 7 MockMvc support. See change log for more details.
  • 2025-12-12: REST Assured 6.0.0 is released. It raises the baseline to Java 17+, upgrades to Groovy 5, adds Spring 7 + Jackson 3 support (and bumps minimum versions for Spring/Yasson/Johnzon). See release notes and change log for more details. more details.

Older News

Examples

Here's an example of how to make a GET request and validate the JSON or XML response:

java
get("/lotto").then().assertThat().body("lotto.lottoId", equalTo(5));

Get and verify all winner ids:

java
get("/lotto").then().assertThat().body("lotto.winners.winnerId", hasItems(23, 54));

Using parameters:

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

Using X-Path (XML only):

java
given().
    params("firstName", "John", "lastName", "Doe").
when().
    post("/greetMe").
then().
    body(hasXPath("/greeting/firstName[text()='John']")).

Need authentication? REST Assured provides several authentication mechanisms:

java
given().auth().basic(username, password).when().get("/secured").then().statusCode(200);

Getting and parsing a response body:

java
// Example with JsonPath
String json = get("/lotto").asString();
List<String> winnerIds = from(json).get("lotto.winners.winnerId");
    
// Example with XmlPath
String xml = post("/shopping").andReturn().body().asString();
Node category = from(xml).get("shopping.category[0]");

REST Assured supports any HTTP method but has explicit support for POST, GET, PUT, DELETE, OPTIONS, PATCH and HEAD and includes specifying and validating e.g. parameters, headers, cookies and body easily.

Documentation

  • Getting started
  • Usage Guide (click here for legacy documentation)
  • Javadoc
  • Rest Assured Javadoc
  • Rest AssuredMockMvc Javadoc
  • XmlPath Javadoc
  • JsonPath Javadoc
  • Release Notes
  • FAQ

Support and discussion

Join the mailing list at our Google group.

Links

  • Change log
  • REST Assured on openhub
  • Mailing list for questions and support

Issues· 597 open

View all issuesOpen on GitHub
  • #1534

    Rest-Assured Throw HttpResponseException Before Then Statement

    Updated Sep 18, 2026
  • #1885

    Response logging log() does not show the json response in utf-8 resulting in unreadable characters

    Updated Aug 28, 2026
  • #1884

    Feature request: ability to use ResponseAwareMatcher for headers in ResponseSpecBuilder

    Updated Aug 21, 2026
  • #1879

    JsonPath: nested `properties` over a list of objects returns null / leaks Groovy meta-data because the list spread result is not the proxy list (Groovy 5 regression)

    Updated Jul 22, 2026
  • #1876

    XmlPath: a negative list index on a hyphenated element name throws a misleading parameter "..." was used but not defined error

    Updated Jul 21, 2026
  • #1875

    JsonPath: array.properties GPath spread returns null (drops all data) when the first array element lacks a properties key (Groovy 5 regression)

    Updated Jul 21, 2026
  • #1874

    JsonPath: large negative JSON numbers overflow to -Infinity (sign-blind float/double selection)

    Updated Jul 21, 2026
  • #1872

    Feature Request: Add Native Support for the HTTP QUERY Method (RFC 10008)

    Updated Jul 12, 2026
  • #1842

    Spring Mock Mvc: Requests with Cookies cause "java.lang.IllegalArgumentException: argument type mismatch"

    Updated Jul 10, 2026
  • #1832

    Do you have any plans to release an official Rest-Assured MCP server to support AI-driven API Automation?

    Updated Jul 8, 2026

> Tags

Javagroovyhttpjavajson

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 22, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言