Skip to content

Fix allure-httpclient request without body - #313

Merged
baev merged 3 commits into
allure-framework:masterfrom
useriq:fixEmptyBodyResponse
Jan 28, 2019
Merged

baev merged 3 commits into
allure-framework:masterfrom
useriq:fixEmptyBodyResponse

Conversation

@useriq

@useriq useriq commented Jan 25, 2019

Copy link
Copy Markdown
Contributor

In the case of receiving apache http response without body, exception occurs: IllegalArgumentException("Body may not be null");
But for response with 304 (Not Modified) code response body must be empty according to RFC: https://restfulapi.net/http-status-codes/ ( This status code is similar to 204 (“No Content”) in that the response body must be empty.

Current PR contains fix of that issue. In case of body absence, "No body is present" will be logged in the allure report.

@CLAassistant

CLAassistant commented Jan 25, 2019 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

import io.qameta.allure.attachment.AttachmentRenderer;
import io.qameta.allure.attachment.DefaultAttachmentProcessor;
import io.qameta.allure.attachment.FreemarkerAttachmentRenderer;
import io.qameta.allure.attachment.*;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this change (in our project we are not using wildcard imports)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry) reverted

@baev baev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a test

@baev

baev commented Jan 25, 2019

Copy link
Copy Markdown
Member

@useriq also in order to have this merged you need to link your commits with your Github account (see the bottom part of CLAassistant message)

@useriq

useriq commented Jan 28, 2019

Copy link
Copy Markdown
Contributor Author

Could you please add a test

test was added

@baev
baev merged commit 26135e7 into allure-framework:master Jan 28, 2019
@baev

baev commented Jan 28, 2019

Copy link
Copy Markdown
Member

@useriq thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants