Skip to content

Allure rest-assured filter requires body for a GET request #125

@aiannucci

Description

@aiannucci

When trying to use the Allure rest-assured filter configured as below:

    @BeforeClass
    public static void initSpec(){
        spec = new RequestSpecBuilder()
                .setContentType(ContentType.JSON)
                .setBaseUri("http://someUri/")
                .addFilter(new AllureRestAssured())
                .build();
    }

    @Test
    public void testGet() {
        given()
                .spec(spec)
                .when()
                .get()
                .then()
                .statusCode(200);
    }

It throws the following error:

java.lang.NullPointerException: Body should not be null value
at java.util.Objects.requireNonNull(Objects.java:228)
at io.qameta.allure.attachment.http.HttpRequestAttachment$Builder.withBody(HttpRequestAttachment.java:131)
at io.qameta.allure.restassured.AllureRestAssured.filter(AllureRestAssured.java:33)

Body should be optional, specially for GET requests which usually don't have a body.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions