use of io.restassured.config.DecoderConfig in project rest-assured by rest-assured.
the class DecoderConfigITest method filters_can_change_content_decoders.
@Test
public void filters_can_change_content_decoders() {
given().config(RestAssuredConfig.newConfig().decoderConfig(DecoderConfig.decoderConfig().contentDecoders(DecoderConfig.ContentDecoder.GZIP, DecoderConfig.ContentDecoder.DEFLATE))).filter((requestSpec, responseSpec, ctx) -> {
final RestAssuredConfig config1 = requestSpec.getConfig();
assertThat(config1.getDecoderConfig().contentDecoders(), Matchers.contains(DecoderConfig.ContentDecoder.GZIP, DecoderConfig.ContentDecoder.DEFLATE));
requestSpec.config(config1.decoderConfig(new DecoderConfig(DecoderConfig.ContentDecoder.DEFLATE)));
return ctx.next(requestSpec, responseSpec);
}).expect().body("Accept-Encoding", contains("deflate")).when().get("/headersWithValues");
}
Aggregations