Skip to content

Commit

Permalink
Revert changes to save backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Jan 10, 2024
1 parent aa3a4dd commit 15bb715
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class DummyClient implements Statistics {

@Override
public Maybe<Response<ResponseBody>> send(StatisticsItem item) {
return Maybe.create(e -> e.onSuccess(Response.success(ResponseBody.create("", MediaType.get("text/plain")))));
return Maybe.create(e -> e.onSuccess(Response.success(ResponseBody.create(MediaType.get("text/plain"), ""))));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@ private HttpRequestUtils() {
public static List<MultipartBody.Part> buildLogMultiPartRequest(List<SaveLogRQ> rqs) {
List<MultipartBody.Part> result = new ArrayList<>();
try {
String payload = MAPPER.writerFor(new TypeReference<List<SaveLogRQ>>() {
}).writeValueAsString(rqs);
result.add(MultipartBody.Part.createFormData(Constants.LOG_REQUEST_JSON_PART,
null,
RequestBody.create(payload, okhttp3.MediaType.get("application/json; charset=utf-8"))
RequestBody.create(okhttp3.MediaType.get("application/json; charset=utf-8"),
MAPPER.writerFor(new TypeReference<List<SaveLogRQ>>() {
}).writeValueAsString(rqs)
)
));
} catch (JsonProcessingException e) {
throw new InternalReportPortalClientException("Unable to process JSON", e);
Expand All @@ -84,7 +85,7 @@ public static List<MultipartBody.Part> buildLogMultiPartRequest(List<SaveLogRQ>
}
result.add(MultipartBody.Part.createFormData(Constants.LOG_REQUEST_BINARY_PART,
file.getName(),
RequestBody.create(file.getContent(), type)
RequestBody.create(type, file.getContent())
));
}
}
Expand Down

0 comments on commit 15bb715

Please sign in to comment.