https://github.com/rest-assured/rest-assured
Java DSL for easy testing of REST services
https://github.com/rest-assured/rest-assured
groovy http java json kotlin rest rest-api test test-automation xml
Last synced: about 1 month ago
JSON representation
Java DSL for easy testing of REST services
- Host: GitHub
- URL: https://github.com/rest-assured/rest-assured
- Owner: rest-assured
- License: apache-2.0
- Created: 2010-10-21T08:35:43.000Z (about 16 years ago)
- Default Branch: master
- Last Pushed: 2026-10-10T19:05:33.000Z (about 1 month ago)
- Last Synced: 2026-10-12T12:23:07.534Z (about 1 month ago)
- Topics: groovy, http, java, json, kotlin, rest, rest-api, test, test-automation, xml
- Language: Java
- Homepage:
- Size: 11.7 MB
- Stars: 7,141
- Watchers: 316
- Forks: 1,943
- Open Issues: 554
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.txt
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
- Agents: AGENTS.md
- Claude: CLAUDE.md
Awesome Lists containing this project
- awesome-sdet-collection - REST Assured - Java DSL for easy testing of REST services. (API Testing / .NET)
- awesome-ccamel - rest-assured/rest-assured - Java DSL for easy testing of REST services (Java)
- awesome - rest-assured - Java DSL for easy testing of REST services (Java)
- awesome-rest - rest-assured - Java DSL for easy testing of REST services. (Testing / Querying)
- awesome-testing - Rest-assured
- awesome-engineering - RestAssured - (<https://rest-assured.io/>) Java DSL for easy testing of REST services (Awesome Tools / Languages)
- awesome-testing - Rest-Assured
- Developer-Handbook - Rest-assured
- awesome-java-zh - REST Assured - 用于轻松测试REST/HTTP服务的DSL。 (项目 / 测试)
- awesome-swedish-opensource - REST-assured - ★1,268 (Java)
- awesome-java - REST Assured - 2.0</kbd> 🟢<br>DSL for easy testing of REST/HTTP services. (Projects)
- awesome-performance-engineering - REST-assured - 🟢 Java DSL for testing REST APIs with fluent syntax and JUnit/TestNG integration. (Performance Testing / API Testing & Contract Testing)
- awesome-rest - rest-assured - Java DSL for easy testing of REST services. (Testing / Querying)
- awesome-integration - REST Assured (⭐7.1k) - A Java DSL that simplifies REST API testing with intuitive syntax and seamless integration into CI pipelines. (Projects / API Testing)
- awesome-java-list - Rest Assured - :Rest Assured是用于轻松测试REST服务的Java DSL。 (测试)
README

[](https://github.com/rest-assured/rest-assured/actions/workflows/ci.yml)
[](https://central.sonatype.com/artifact/io.rest-assured/rest-assured)
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-10-16: REST Assured 6.2.0 is released. The `rest-assured` module is now written entirely in Java and no longer depends on Groovy directly. Tests that run in parallel no longer fail because of races in the static configuration, and `auth().certificate(..)` now sends the client certificate to servers that ask for one (mutual TLS). Many failures that used to show up as Groovy exceptions or a `NullPointerException` now give a clear error message, and `scala-support` is upgraded to a Scala version that fixes CVE-2022-36944. This release contains several non-backward compatible changes, so please read the [release notes](https://github.com/rest-assured/rest-assured/wiki/ReleaseNotes62) before upgrading. See also the [change log](https://raw.githubusercontent.com/rest-assured/rest-assured/master/changelog.txt) for more details.
* 2026-10-09: REST Assured 6.1.0 is released. It adds support for the HTTP QUERY method, JSON Schema draft-06, draft-07, 2019-09 and 2020-12, and `java.time` values as parameters. Authorization and Cookie headers are no longer sent along when a redirect goes to a different host. There are also many bug fixes, several of them from the community. See [release notes](https://github.com/rest-assured/rest-assured/wiki/ReleaseNotes61) and [change log](https://raw.githubusercontent.com/rest-assured/rest-assured/master/changelog.txt) for more details.
* 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](https://raw.githubusercontent.com/rest-assured/rest-assured/master/changelog.txt) for more details.
[Older News](https://github.com/rest-assured/rest-assured/wiki/OldNews)
## 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 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](https://github.com/rest-assured/rest-assured/wiki/GettingStarted)
* [Usage Guide](https://github.com/rest-assured/rest-assured/wiki/Usage) (click [here](https://github.com/rest-assured/rest-assured/wiki/Usage_Legacy) for legacy documentation)
* [Javadoc](http://www.javadoc.io/doc/io.rest-assured/rest-assured/6.2.0)
* [Rest Assured Javadoc](http://static.javadoc.io/io.rest-assured/rest-assured/6.2.0/io/restassured/RestAssured.html)
* [Rest AssuredMockMvc Javadoc](http://static.javadoc.io/io.rest-assured/spring-mock-mvc/6.2.0/io/restassured/module/mockmvc/RestAssuredMockMvc.html)
* [XmlPath Javadoc](http://static.javadoc.io/io.rest-assured/xml-path/6.2.0/io/restassured/path/xml/XmlPath.html)
* [JsonPath Javadoc](http://static.javadoc.io/io.rest-assured/json-path/6.2.0/io/restassured/path/json/JsonPath.html)
* [Release Notes](https://github.com/rest-assured/rest-assured/wiki/ReleaseNotes)
* [FAQ](https://github.com/rest-assured/rest-assured/wiki/FAQ)
## Support and discussion
Join the mailing list at our [Google group](http://groups.google.com/group/rest-assured).
## Links
* [Change log](https://github.com/rest-assured/rest-assured/raw/master/changelog.txt)
* REST Assured on [openhub](https://www.openhub.net/p/rest-assured)
* [Mailing list](http://groups.google.com/group/rest-assured) for questions and support
