Skip to content

Commit

Permalink
Fixed typo in Javadoc of ValidatableResponseOptions.java (#1164)
Browse files Browse the repository at this point in the history
The Javadoc of T header(String headerName, ResponseAwareMatcher<R> expectedValueMatcher) shows an example that does not compile:

```
assertThat().header("Location", response -> response.endsWith("/x/") + response.path("id"));
```

in fact, `endsWith` is not a method of response, it's an Hamcrest matcher. This small patch fixes the example in the Javadoc. I propose the fix according to one of the tests of REST Assured itself, https://github.com/rest-assured/rest-assured/blob/master/examples/rest-assured-itest-java/src/test/java/io/restassured/itest/java/HeaderITest.java#L220
  • Loading branch information
LorenzoBettini authored and johanhaleby committed May 3, 2019
1 parent 165a85b commit 34cc24a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public interface ValidatableResponseOptions<T extends ValidatableResponseOptions
* To verify that the Location header ends with "/x/{id}" you can do like this:
* <p>
* <pre>
* given().param("id", 1).body(..).post("/x").then().assertThat().header("Location", response -> response.endsWith("/x/") + response.path("id"));
* given().param("id", 1).body(..).post("/x").then().assertThat().header("Location", response -> endsWith("/x/" + response.path("id")));
* </pre>
* </p>
* <p/>
Expand Down

0 comments on commit 34cc24a

Please sign in to comment.