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

Add more shortcut methods for convenience #1576

Merged
merged 2 commits into from Feb 11, 2019
Merged

Conversation

trustin
Copy link
Member

@trustin trustin commented Feb 8, 2019

Motivation:

Skimmed through our test cases and thought a few shortcut methods would
be useful to reduce some tedious repetition.

Modifications:

  • Added contentType() to:
    • HttpRequest
    • AggregatedHttpMessage
  • Added contentUtf8(), contentAscii() and content(Charset) to
    AggregatedHttpMessage.
  • Accepted CharSequence as well as String in:
    • HttpRequest.of()
    • HttpRespons.of()
    • AggregatedHttpMessage.of()
  • Replaced the old usage with the new concise usage.

Result:

Brevity.

@codecov
Copy link

codecov bot commented Feb 8, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@82bc639). Click here to learn what that means.
The diff coverage is 54.54%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1576   +/-   ##
=========================================
  Coverage          ?   72.71%           
  Complexity        ?     7509           
=========================================
  Files             ?      695           
  Lines             ?    30230           
  Branches          ?     3689           
=========================================
  Hits              ?    21982           
  Misses            ?     6349           
  Partials          ?     1899
Impacted Files Coverage Δ Complexity Δ
.../com/linecorp/armeria/server/grpc/GrpcService.java 95.06% <100%> (ø) 23 <6> (?)
...ver/annotation/StringRequestConverterFunction.java 50% <100%> (ø) 3 <0> (?)
.../annotation/ByteArrayRequestConverterFunction.java 50% <100%> (ø) 3 <2> (?)
...er/annotation/JacksonRequestConverterFunction.java 82.35% <100%> (ø) 6 <3> (?)
...ecorp/armeria/server/grpc/UnframedGrpcService.java 80.55% <100%> (ø) 17 <0> (?)
...eria/server/annotated/MessageConverterService.java 87.87% <100%> (ø) 8 <0> (?)
...a/testing/internal/webapp/WebAppContainerTest.java 93.7% <100%> (ø) 17 <0> (?)
.../com/linecorp/armeria/server/saml/SamlService.java 71.95% <100%> (ø) 9 <0> (?)
...orp/armeria/client/thrift/THttpClientDelegate.java 78.86% <100%> (ø) 22 <0> (?)
...ia/internal/annotation/AnnotatedValueResolver.java 87.42% <100%> (ø) 110 <0> (?)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 82bc639...1cf66ad. Read the comment docs.

Motivation:

Skimmed through our test cases and thought a few shortcut methods would
be useful to reduce some tedious repetition.

Modifications:

- Added `contentType()` to:
  - `HttpRequest`
  - `AggregatedHttpMessage`
- Added `contentUtf8()`, `contentAscii()` and `content(Charset)` to
  `AggregatedHttpMessage`.
- Accepted `CharSequence` as well as String in:
  - `HttpRequest.of()`
  - `HttpRespons.of()`
  - `AggregatedHttpMessage.of()`
- Replaced the old usage with the new concise usage.

Result:

Brevity.
@line line deleted a comment from codecov bot Feb 11, 2019
@trustin trustin merged commit f5c5081 into line:master Feb 11, 2019
@trustin trustin deleted the more_shortcuts branch February 11, 2019 14:44
@trustin
Copy link
Member Author

trustin commented Feb 11, 2019

Thanks, @minwoox !

fmguerreiro pushed a commit to fmguerreiro/armeria that referenced this pull request Sep 19, 2020
Motivation:

Skimmed through our test cases and thought a few shortcut methods would
be useful to reduce some tedious repetition.

Modifications:

- Added `contentType()` to:
  - `HttpRequest`
  - `AggregatedHttpMessage`
- Added `contentUtf8()`, `contentAscii()` and `content(Charset)` to
  `AggregatedHttpMessage`.
- Accepted `CharSequence` as well as String in:
  - `HttpRequest.of()`
  - `HttpRespons.of()`
  - `AggregatedHttpMessage.of()`
- Replaced the old usage with the new concise usage.

Result:

Brevity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants