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.
When trying to use the Allure rest-assured filter configured as below:
It throws the following error:
Body should be optional, specially for GET requests which usually don't have a body.