REST Assured

Build Status Maven Central

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.

Fork me on GitHub

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-apache5 module, and no longer depends on Groovy. You pick a path engine for body(..) paths and jsonPath(): json-path-gpath, xml-path-gpath or json-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. The rest-assured-openrewrite recipe 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-openrewrite module has a recipe that moves your code over. Among the replacements are timeouts as Duration in HttpClientConfig, SSLContext support in SSLConfig and followRedirectsForAllMethods(..) in RedirectConfig. 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-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 before upgrading. See also the change log for more details.
Release Notes
Docs
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.