ReleaseNotes145

Johan Haleby edited this page Jul 21, 2015 · 4 revisions

Release Notes for REST Assured 1.4.5

Highlights

  • 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 and cookieName=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 and headerName=value2.

Non-backward compatible changes

Other notable changes

  • 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);

Minor changes

See change log for more details

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.