Closed Dyadko closed 1 year ago
Probably not a bug
resolved issue with setting custom BodyTypeMap
:
public static final Map<String, BodyType> BODY_TYPE_MAP = Map.of(
"text/json", BodyType.TEXT,
"custom_type", BodyType.TEXT,
org.apache.http.entity.ContentType.TEXT_XML.getMimeType(), BodyType.TEXT,
org.apache.http.entity.ContentType.APPLICATION_JSON.getMimeType(), BodyType.TEXT,
org.apache.http.entity.ContentType.TEXT_HTML.getMimeType(), BodyType.TEXT
);
static {
RestAssured.useRelaxedHTTPSValidation();
RestAssured.filters(
new ReportPortalRestAssuredLoggingFilter(
42,
LogLevel.INFO)
.setBodyTypeMap(BODY_TYPE_MAP),
new RestAssuredConsoleFilter(),
new AllureRestAssured()
);
}
Describe the bug Registered custom prettier provokes
Steps to Reproduce Steps to reproduce the behavior:
custom_type
as per README.mdfor me it was like
Content-Type
:custom_type
and valid json in body.Expected behavior According to
REPORTPORTAL_PRETTIERS
theContent-Type
:custom_type
should be treated as usual JSONActual behavior Unable to send a request as ReportPortal fails being unable to cast
String
tobyte[]
Dependency versions
Additional context Seems like any mimeTypes, if they are not in
DEFAULT_PRETTIERS
map predefined in code, lead toBodyType
detected asBINARY
. ForBINARY
body is parsed asbyte[]
even beingString
. I'd vote to detectBodyType
asTEXT
if a prettier is registered - as parsing logic is defined inPrettier
implementation.