Spring Web client interceptor integration for Allure Java.
io.qameta.allure:allure-spring-web
dependencies {
testImplementation(platform("io.qameta.allure:allure-bom:<allure-version>"))
testImplementation("io.qameta.allure:allure-spring-web")
}Register io.qameta.allure.springweb.AllureRestTemplate with RestTemplate or another synchronous Spring HTTP client that accepts ClientHttpRequestInterceptor.
RestTemplate restTemplate = new RestTemplate(
new BufferingClientHttpRequestFactory(new SimpleClientHttpRequestFactory())
);
restTemplate.getInterceptors().add(new AllureRestTemplate());- Request method, URI, headers, body, and timing.
- Response status, status text, headers, and body.
- A single structured HTTP exchange attachment.
Configure a buffering request factory when caller code also needs to read the response body after interception.