Testing and validating 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. For example, if your HTTP server returns the following JSON at “http://localhost:8080/lotto/{id}”:
{
"lotto":{
"lottoId":5,
"winning-numbers":[2,45,34,23,7,5,3],
"winners":[
{
"winnerId":23,
"numbers":[2,45,34,23,3,5]
},
{
"winnerId":54,
"numbers":[52,3,12,11,18,22]
}
]
}
}
You can easily use REST Assured to validate interesting things from the response:
@Test public void
lotto_resource_returns_200_with_expected_id_and_winners() {
when().
get("/lotto/{id}", 5).
then().
statusCode(200).
body("lotto.lottoId", equalTo(5),
"lotto.winners.winnerId", hasItems(23, 54));
}
Looks easy enough? Why not give it a spin? See getting started and usage guide.
News
News
- 2026-11-12: REST Assured 7.0.0-RC1 is released. It’s the release candidate for 7.0.0, a new major release. REST Assured now sends requests with the JDK’s HTTP client by default, with Apache HttpClient 5 in the new
http-client-apache5module, and no longer depends on Groovy. You pick a path engine forbody(..)paths andjsonPath():json-path-gpath,xml-path-gpathorjson-path-jayway. Java 17 is required. This release contains several non-backward compatible changes, so please read the release notes and which module do I need before upgrading. Therest-assured-openrewriterecipe moves most code over. Please try it and report what breaks! See the change log for more details. - 2026-10-23: REST Assured 6.3.0 is released. It prepares for REST Assured 7.0.0, which drops Apache HttpClient 4 and Groovy from the default dependencies. Every API that 7.0.0 removes now has a replacement, the old ones are deprecated, and the new
rest-assured-openrewritemodule has a recipe that moves your code over. Among the replacements are timeouts asDurationinHttpClientConfig,SSLContextsupport inSSLConfigandfollowRedirectsForAllMethods(..)inRedirectConfig. Form authentication now also uses the config and proxy of your request for all its requests. See Preparing for REST Assured 7.0, the release notes and the change log for more details. - 2026-10-16: REST Assured 6.2.0 is released. The
rest-assuredmodule 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, andauth().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 aNullPointerExceptionnow give a clear error message, andscala-supportis upgraded to a Scala version that fixes CVE-2022-36944. This release contains several non-backward compatible changes, so please read the release notes before upgrading. See also the change log for more details.
Release Notes
Docs
Documentation
- Getting started
- Downloads
- Usage Guide (click here for legacy documentation)
- Javadoc
- Rest Assured Javadoc
- Rest AssuredMockMvc Javadoc
- XmlPath Javadoc
- JsonPath Javadoc
- Release Notes
- FAQ
Who
Who
REST Assured is developed and maintained by Johan Haleby with the help of numerous other contributors over the years. Would you like to contribute to the project in any way? Submit a pull request or contact Johan at Twitter.
Johan started the project when he was working at Jayway back in December of 2010. The project is now sponsored by Parkster.
