REST Assured 1.5
Highlights
Section titled “Highlights”-
Fixed an issue with the PUT method duplicating form parameters as query parameters (issue 137)
-
Created a ResponseBuilder to make it easier to create new Response implementations. This is useful if you’re working with filters and want to change the response you get from the sever somehow. E.g.
Response myResponse = new ResponseBuilder().clone(originalResponse).setBody("Something").build(); -
Added possibility for some more detailed configuration by providing a RestAssuredConfig instance. Right now you can configure the parameters of HTTP Client, Redirect and Log settings. Examples: For a specific request:
given().config(newConfig().redirect(redirectConfig().followRedirects(false))). ..or using a RequestSpecBuilder:
RequestSpecification spec = new RequestSpecBuilder().setConfig(newConfig().redirect(redirectConfig().followRedirects(false))).build();or for all requests:
RestAssured.config = config().redirect(redirectConfig().followRedirects(true).and().maxRedirects(0));config()andnewConfig()can be statically imported fromcom.jayway.restassured.config.RestAssuredConfig. -
Logging has been improved, see below.
Non-backward compatible changes
Section titled “Non-backward compatible changes”-
Logging has undergone a major change. You can now not only log the response body but also headers, cookies and status line. You can also log the request details as defined in the request specification. Thus the following:
given().log(). .. // Log the response body in versions prior to 1.5and
expect().log(). .. // Also logs the response body in versions prior to 1.5will now look like this:
given().log().body(). .. // Log the _request_ body in versions >= 1.5and
expect().log().body() .. // Log the response body in versions >= 1.5You can also log e.g. only headers in the request and the response:
given().log().headers(). .. // Log only the request headersand
expect().log().headers(). .. // Log only the response headersPreviously there was a method called
logOnErrorin both the request- and response specification. This has now been replaced by the following method in the response specification:expect().log().ifError(). ..(issue 81).
-
getRequestParams()andgetQueryParams()now returnsMap<String, ?>instead ofMap<String, String>in FilterableRequestSpecification.
Other notable changes
Section titled “Other notable changes”-
Allows configuring redirect settings using the DSL (issue 24), e.g.
given().redirects().max(12).and().redirects().follow(true).when(). ..
Minor changes
Section titled “Minor changes”See change log for more details

