| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
Apache HttpClient 4 interceptor integration for Allure Java.
Use this module when your tests or test clients use Apache HttpClient 4 and you want request and response details to appear in Allure Report.
Gradle:
dependencies {
testImplementation(platform("io.qameta.allure:allure-bom:<allure-version>"))
testImplementation("io.qameta.allure:allure-httpclient")
}Maven, with allure-bom imported in dependency management:
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-httpclient</artifactId>
<scope>test</scope>
</dependency>Register the request and response interceptors on an HttpClient 4 builder:
AllureHttpClientResponse responseInterceptor = new AllureHttpClientResponse()
.configureHttpExchange(exchange -> exchange.redactHeader("Authorization"));
CloseableHttpClient client = HttpClientBuilder.create()
.addInterceptorFirst(new AllureHttpClientRequest())
.addInterceptorLast(responseInterceptor)
.build();Register both interceptors together so Allure can combine request and response data from the same exchange.
Use allure-httpclient5 for Apache HttpClient 5.
| Back | FazBrowse Home | New Git URL |