-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
ReleaseNotes145
-
Better support for cookies:
-
You can now create multi-value cookies using e.g.
given().cookie("cookieName", "value1", "value2"). ..
This will create two cookies,
cookieName=value1
andcookieName=value2
. -
Fixed a serious issue with the cookie parsing that caused cookie attributes to be parsed as a new cookie (issue 130).
-
Support for getting detailed cookies using the Response.getDetailedCookies() method. You can also get a single detailed cookie using the Response.getDetailedCookie(java.lang.String) method. Detailed cookies contains e.g. comment, path and expiry date.
-
Creation of detailed cookies:
Cookie someCookie = new Cookie.Builder("some_cookie", "some_value").setSecured(true).build(); given().cookie(someCookie).and().expect().body(equalTo("x")).when().get("/cookie");
-
Better support for headers: You can now create multi-value headers using e.g.
given().header("headerName", "value1", "value2"). ..
This will create two headers,
headerName=value1
andheaderName=value2
.
- To allow for multi-value headers the old Response.getHeaders() and Response.headers() no longer returns
Map<String,String>
. Now these methods returns a Headers instance instead.
-
Added support for serializing objects to a parameter if the content-type is set:
given(). contentType("application/json"). queryParam("category", "Games"). formParam("object", new GameObject(..)). // GameObject will be serialized to JSON when(). post("/somewhere");
-
Added support for mapping a path to a Java object in JsonPath, e.g:
Book book = from(JSON).getObject("store.book[2]", Book.class);
See change log for more details