Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] [plugin-rest-api] Move response time value reporting from sub-steps to attachment #3829

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

EDbarvinsky
Copy link
Contributor

@EDbarvinsky EDbarvinsky commented Apr 13, 2023

  • update unit tests

{
Header[] headers = response.getResponseHeaders();
String attachmentTitle = String.format("Response: %s %s", response.getMethod(), response.getFrom());
String mimeType = getMimeType(headers).orElseGet(ContentType.DEFAULT_TEXT::getMimeType);
attachApiMessage(attachmentTitle, headers, response.getResponseBody(), mimeType, response.getStatusCode());
attachApiMessage(attachmentTitle, headers, response.getResponseBody(), mimeType, response.getStatusCode(),
response.getResponseTimeInMs());
Copy link
Contributor Author

@EDbarvinsky EDbarvinsky Apr 13, 2023

Choose a reason for hiding this comment

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

6 args to much ?
can be replaced with response

Copy link
Collaborator

Choose a reason for hiding this comment

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

you won't be able to use response in attachApiMessage since it's used to requests as well

@codecov
Copy link

codecov bot commented Apr 13, 2023

Codecov Report

Merging #3829 (9a78df0) into master (792c5fe) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

❗ Current head 9a78df0 differs from pull request most recent head 1478cf8. Consider uploading reports for the commit 1478cf8 to get more accurate results

@@             Coverage Diff              @@
##             master    #3829      +/-   ##
============================================
- Coverage     97.07%   97.05%   -0.03%     
+ Complexity     6111     6108       -3     
============================================
  Files           850      850              
  Lines         17484    17462      -22     
  Branches       1141     1139       -2     
============================================
- Hits          16973    16948      -25     
- Misses          406      408       +2     
- Partials        105      106       +1     
Impacted Files Coverage Δ
.../vividus/http/PublishingAttachmentInterceptor.java 100.00% <100.00%> (ø)

... and 5 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -80,25 +80,28 @@ public void process(HttpRequest request, EntityDetails entityDetails, HttpContex
}
}
}
attachApiMessage("Request: " + request, request.getHeaders(), body, mimeType, -1);
attachApiMessage("Request: " + request, request.getHeaders(), body, mimeType, -1, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
attachApiMessage("Request: " + request, request.getHeaders(), body, mimeType, -1, 0);
attachApiMessage("Request: " + request, request.getHeaders(), body, mimeType, -1, -1);

{
Header[] headers = response.getResponseHeaders();
String attachmentTitle = String.format("Response: %s %s", response.getMethod(), response.getFrom());
String mimeType = getMimeType(headers).orElseGet(ContentType.DEFAULT_TEXT::getMimeType);
attachApiMessage(attachmentTitle, headers, response.getResponseBody(), mimeType, response.getStatusCode());
attachApiMessage(attachmentTitle, headers, response.getResponseBody(), mimeType, response.getStatusCode(),
response.getResponseTimeInMs());
Copy link
Collaborator

Choose a reason for hiding this comment

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

you won't be able to use response in attachApiMessage since it's used to requests as well

<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Loggers>
<Logger name="org.vividus.http.HttpRequestExecutor" level="INFO" additivity="false">
Copy link
Collaborator

Choose a reason for hiding this comment

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

😮

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.

2 participants