GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — allure-java/allure-java-httpclient at main · allure-framework/allure-java

Expand file tree

/

allure-java-httpclient

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

allure-java-httpclient

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
src
src
 
 
README.md
README.md
 
 
build.gradle.kts
build.gradle.kts
 
 

README.md

Outline

allure-java-httpclient

Java built-in HTTP Client integration for Allure Java.

Use this module to capture requests and responses sent through java.net.http.HttpClient as structured HTTP exchange attachments in Allure Report.

Supported Versions

  • Allure Java 3.x requires Java 17 or newer.
  • The wrapped HTTP client API is available since Java 11.
  • Synchronous requests, asynchronous requests, and accepted HTTP/2 push promises are supported.

Installation

Gradle:

dependencies {
    testImplementation(platform("io.qameta.allure:allure-bom:<allure-version>"))
    testImplementation("io.qameta.allure:allure-java-httpclient")
}

Maven, with allure-bom imported in dependency management:

<dependency>
    <groupId>io.qameta.allure</groupId>
    <artifactId>allure-java-httpclient</artifactId>
    <scope>test</scope>
</dependency>

Setup

Wrap the client used by your tests with io.qameta.allure.javahttpclient.AllureHttpClient.

HttpClient httpClient = AllureHttpClient.wrap(
        HttpClient.newBuilder().build()
);

HttpRequest request = HttpRequest.newBuilder(URI.create("https://example.test/api/items"))
        .GET()
        .build();

HttpResponse<String> response = httpClient.send(
        request,
        HttpResponse.BodyHandlers.ofString()
);

The wrapper passes calls through unchanged when no Allure test or fixture is running.

Customize redaction and body limits before sharing the client:

HttpClient httpClient = AllureHttpClient.wrap(HttpClient.newHttpClient())
        .configureHttpExchange(exchange -> exchange
                .redactHeader("X-Api-Key")
                .redactQueryParameter("token")
                .setMaxBodySize(64 * 1024));

Report Output

  • One HTTP exchange attachment for each completed request or accepted push promise.
  • Request method, URL, HTTP version, headers, and captured body.
  • Response status, HTTP version, headers, and captured body.
  • Transport errors when a request completes exceptionally.

Streaming response handlers remain streaming. The attachment contains the response bytes delivered by the time the response future completes; consume or close streaming bodies as required by HttpClient.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.