REST Assured 6.3.0
Highlights
Section titled “Highlights”-
6.3.0 prepares for REST Assured 7.0.0. REST Assured 7.0.0 removes Apache HttpClient 4 and Groovy from the default dependencies. It sends requests with the JDK’s own HTTP client, and GPath (
json-pathandxml-path) becomes a dependency that you add yourself. 6.3.0 adds a replacement for every API that 7.0.0 removes and deprecates the old ones, so you can move your code over while it still compiles and runs on 6.x. Code without deprecation warnings on 6.3.0 should need little more than a version change and a dependency in 7.0.0. Read Preparing for REST Assured 7.0 for what to change. -
A new
rest-assured-openrewritemodule with the OpenRewrite recipeio.restassured.MigrateRestAssured6Deprecations, which moves most of your Java code to the replacements automatically. With Maven:Terminal window mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \-Drewrite.recipeArtifactCoordinates=io.rest-assured:rest-assured-openrewrite:6.3.0 \-Drewrite.activeRecipes=io.restassured.MigrateRestAssured6DeprecationsSee Preparing for REST Assured 7.0 for Gradle and for what the recipe doesn’t change.
-
New settings that don’t depend on HttpClient 4:
-
Timeouts and other HTTP settings in
HttpClientConfig:connectTimeout(Duration),readTimeout(Duration),connectionRequestTimeout(Duration),keepResponseCookies(boolean),cookieDatePatterns(String...),expectContinue(boolean)andmultipartMode(MultipartMode):RestAssured.config = RestAssured.config().httpClient(httpClientConfig().connectTimeout(Duration.ofSeconds(5)).readTimeout(Duration.ofSeconds(10))); -
SSLConfig.sslContext(SSLContext)andhostnameVerifier(HostnameVerifier), with the JDK’sjavax.net.ssltypes, and the same onCertificateAuthSettings. -
RedirectConfig.followRedirectsForAllMethods(true)follows redirects ofPOST,PUT,DELETEand other requests too. Use it instead of installing HttpClient 4’sLaxRedirectStrategythrough anHttpClientFactory. -
CookieFilter.getCookies()andaddCookie(Cookie), instead ofgetCookieStore(). -
ContextAuthenticationSchemeandAuthenticationContextfor custom authentication schemes, instead ofauthenticate(HTTPBuilder):ContextAuthenticationScheme apiKey = context -> context.header("X-Api-Key", "my-key");
-
-
The object mapper factories (
Jackson2ObjectMapperFactory,GsonObjectMapperFactoryand so on) andNumberReturnTypeare now also inrest-assured-common, inio.restassured.common.mapper.factoryandio.restassured.common.config. The old types injson-pathandxml-pathextend the new ones, so existing code keeps working. -
json-path-gpathandxml-path-gpathare published. They’re the 7.0.0 names ofjson-pathandxml-path, and in 6.x they resolve tojson-pathandxml-path, so you can switch your build to the new names now. -
Form authentication sends its extra requests (the CSRF token page, the follow-up of a 302 of the login page, and the login request) with the config and the proxy of your request. Before, only the static
RestAssuredsettings applied to them, so for examplerelaxedHTTPSValidation(), a key store or a proxy set on the request was lost after the first request. It also no longer sends the login page cookies to another host when it follows a 302 of the login page (thanks to Obrams for the PR). -
When an older
rest-assured-commonends up on the classpath, for example one pinned by the Spring Boot 3 dependency management, REST Assured,RestAssuredMockMvcandRestAssuredWebTestClientnow fail with anIllegalStateExceptionthat explains how to align the versions, instead of aNoClassDefFoundError.
Preparing for 7.0.0
Section titled “Preparing for 7.0.0”These APIs are deprecated in 6.3.0. The ones that expose HttpClient 4 or Jackson 1 are removed in 7.0.0, and the rest in 8.0.0:
| Deprecated | Use instead |
|---|---|
HttpClientConfig.setParam(..) and the other parameter methods |
connectTimeout(..), readTimeout(..), connectionRequestTimeout(..), keepResponseCookies(..), cookieDatePatterns(..), expectContinue(..), RedirectConfig and a User-Agent header |
HttpClientConfig.httpClientFactory(..), HttpClientFactory and httpClientInstance() |
Nothing in 6.x. REST Assured 7.0.0 adds customizeClient(..) |
HttpClientConfig.httpMultipartMode(..) |
multipartMode(MultipartMode) |
SSLConfig.sslSocketFactory(..) and x509HostnameVerifier(..), and the same on CertificateAuthSettings and CertAuthScheme |
sslContext(..) and hostnameVerifier(..) |
CookieFilter.getCookieStore() |
getCookies() and addCookie(..) |
AuthenticationScheme.authenticate(HTTPBuilder) |
ContextAuthenticationScheme |
QueryableRequestSpecification.getHttpClient() |
Nothing |
The object mapper factories in io.restassured.path.json.mapper.factory and io.restassured.path.xml.mapper.factory |
The same names in io.restassured.common.mapper.factory |
JsonPathConfig.NumberReturnType |
io.restassured.common.config.NumberReturnType |
jackson1ObjectMapperFactory(..) and JsonPath.using(Jackson1ObjectMapperFactory) |
Jackson 2 or 3 |
Preparing for REST Assured 7.0 has examples for each of these.
Non-backward compatible changes
Section titled “Non-backward compatible changes”-
In Groovy 4 (but not Groovy 5), passing a closure directly to an object mapper factory setter, such as
objectMapperConfig().jackson2ObjectMapperFactory { type, charset -> new ObjectMapper() }, now fails with “Ambiguous method overloading”, since the setters take both the old and the new factory type. Cast the closure to the factory type:objectMapperConfig().jackson2ObjectMapperFactory({ type, charset -> new ObjectMapper() } as Jackson2ObjectMapperFactory) -
Passing
nulltonumberReturnType(..),new JsonConfig(..)ornew JsonPathConfig(..)is now ambiguous and needs a cast, since they take both the old and the newNumberReturnType.
Other changes
Section titled “Other changes”rest-assured-common now has optional dependencies on the JSON and XML mappers its factories use. They are optional, so nothing new ends up on your classpath.
See the change log for all changes.

