MCPcopy
hub / github.com/rest-assured/rest-assured

github.com/rest-assured/rest-assured @rest-assured-6.0.0 sqlite

repository ↗ · DeepWiki ↗ · release rest-assured-6.0.0 ↗
5,037 symbols 35,786 edges 537 files 1,511 documented · 30%
README

REST Assured

Build Status Maven Central

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

  • 2025-08-15: REST Assured 5.5.6 is released with bug fixes and minor improvements. See change log for more details.
  • 2025-05-22: REST Assured 5.5.5 is released that fixes problems with rest-assured-bom file after moving to new deployment method. See change log for more details.
  • 2025-05-22: REST Assured 5.5.3 is released with improved cookie handling when using CSRF cookie propagation. See change log for more details.

Older News

Examples

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

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

Get and verify all winner ids:

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

Using parameters:

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

Using X-Path (XML only):

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

Need authentication? REST Assured provides several authentication mechanisms:

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

Getting and parsing a response body:

// 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

Support and discussion

Join the mailing list at our Google group.

Links

Buy Me A Coffee

Extension points exported contracts — how you extend this code

ObjectMapperFactory (Interface)
The base interface for object mapper factories. @param The type of the created object mapper. [10 implementers]
rest-assured-common/src/main/java/io/restassured/common/mapper/factory/ObjectMapperFactory.java
XmlPathObjectDeserializer (Interface)
Interface for all XmlPath object deserializers. It's possible to roll your own implementation if the pre-defined de-seri [10 …
xml-path/src/main/java/io/restassured/path/xml/mapping/XmlPathObjectDeserializer.java
RequestSenderOptions (Interface)
Options available when sending a request. @param The type of response options. [7 implementers]
rest-assured/src/main/java/io/restassured/specification/RequestSenderOptions.java
JsonPathObjectDeserializer (Interface)
Interface for all JsonPath object deserializers. It's possible to roll your own implementation if the pre-defined de-ser [16 …
json-path/src/main/java/io/restassured/path/json/mapping/JsonPathObjectDeserializer.java
ValidatableWebTestClientResponse (Interface)
A validatable response of a request made by REST Assured WebTestClient. Returns an instance of {@link WebTestClient.Resp [5 …
modules/spring-web-test-client/src/main/java/io/restassured/module/webtestclient/response/ValidatableWebTestClientResponse.java
ClientConfig (Interface)
(no doc) [28 implementers]
modules/spring-commons/src/main/java/io/restassured/module/spring/commons/config/ClientConfig.java
MockHttpServletRequestBuilderInterceptor (Interface)
Implement this interface to intercept the MockHttpServletRequestBuilder before it's built. [2 implementers]
modules/spring-mock-mvc/src/main/java/io/restassured/module/mockmvc/intercept/MockHttpServletRequestBuilderInterceptor.java
ObjectDeserializationContext (Interface)
Class containing details needed for deserializing a response to a Java class. [2 implementers]
rest-assured-common/src/main/java/io/restassured/common/mapper/ObjectDeserializationContext.java

Core symbols most depended-on inside this repo

body
called by 1159
rest-assured/src/main/java/io/restassured/response/ResponseOptions.java
when
called by 1026
rest-assured/src/main/java/io/restassured/specification/RequestSpecification.java
get
called by 936
xml-path/src/main/java/io/restassured/path/xml/element/PathElement.java
assertThat
called by 865
rest-assured/src/main/java/io/restassured/response/ValidatableResponseOptions.java
given
called by 671
rest-assured/src/main/java/io/restassured/specification/RequestSpecification.java
expect
called by 531
rest-assured/src/main/java/io/restassured/specification/RequestSpecification.java
then
called by 488
rest-assured/src/main/java/io/restassured/response/Validatable.java
statusCode
called by 432
rest-assured/src/main/java/io/restassured/response/ResponseOptions.java

Shape

Method 4,459
Class 488
Interface 71
Enum 19

Languages

Java100%

Modules by API surface

modules/spring-mock-mvc/src/main/java/io/restassured/module/mockmvc/internal/MockMvcRequestSpecificationImpl.java75 symbols
rest-assured/src/main/java/io/restassured/internal/RestAssuredResponseOptionsImpl.java74 symbols
json-path/src/test/java/io/restassured/path/json/JsonPathTest.java74 symbols
examples/rest-assured-itest-java/src/test/java/io/restassured/itest/java/LoggingITest.java71 symbols
examples/rest-assured-itest-java/src/test/java/io/restassured/itest/java/JSONGetITest.java70 symbols
modules/spring-web-test-client/src/main/java/io/restassured/module/webtestclient/internal/WebTestClientRequestSpecificationImpl.java64 symbols
xml-path/src/test/java/io/restassured/path/xml/XmlPathTest.java61 symbols
examples/rest-assured-itest-java/src/test/java/io/restassured/itest/java/PathParamITest.java55 symbols
xml-path/src/main/java/io/restassured/path/xml/XmlPath.java50 symbols
json-path/src/main/java/io/restassured/path/json/JsonPath.java50 symbols
examples/rest-assured-itest-java/src/test/java/io/restassured/itest/java/URLITest.java48 symbols
rest-assured/src/main/java/io/restassured/specification/RequestSpecification.java47 symbols

Dependencies from manifests, versioned

ch.qos.logback:logback-classic
com.fasterxml.jackson.core:jackson-core
com.fasterxml.jackson.module:jackson-module-kotlin
com.github.java-json-tools:json-schema-validator2.2.14 · 1×
com.github.scribejava:scribejava-apis
com.googlecode.json-simple:json-simple1.1.1 · 1×
com.squareup.okhttp3:mockwebserver3-junit55.3.2 · 1×
com.sun.xml.bind:jaxb-impl2.3.4 · 1×
commons-fileupload:commons-fileupload1.3.3 · 1×

For agents

$ claude mcp add rest-assured \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact