use of io.restassured.config.LogConfig in project rest-assured by rest-assured.
the class PathParamITest method urlEncodesUnnamedPathParametersThatContainsCurlyBracesAndEquals.
@Test
public void urlEncodesUnnamedPathParametersThatContainsCurlyBracesAndEquals() throws Exception {
// When
final StringWriter writer = new StringWriter();
final PrintStream captor = new PrintStream(new WriterOutputStream(writer), true);
given().config(RestAssuredConfig.config().logConfig(new LogConfig(captor, true))).log().all().filter(new Filter() {
public Response filter(FilterableRequestSpecification requestSpec, FilterableResponseSpecification responseSpec, FilterContext ctx) {
return new ResponseBuilder().setStatusCode(200).setBody("changed").build();
}
}).get("/feed?canonicalName={trackingName}&platform=ed4", "{trackingName='trackingname1'}");
// Then
assertThat(RequestPathFromLogExtractor.loggedRequestPathIn(writer), equalTo("http://localhost:8080/feed?canonicalName=%7BtrackingName%3D%27trackingname1%27%7D&platform=ed4"));
}
Aggregations