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

feat(server): migrate pascal case http headers rule to context object to support openapi 3 #820

Merged
merged 3 commits into from Sep 11, 2018

Conversation

maxim-tschumak
Copy link
Contributor

Related to #714

@codecov-io
Copy link

codecov-io commented Aug 24, 2018

Codecov Report

Merging #820 into master will increase coverage by 0.24%.
The diff coverage is 75%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master    #820      +/-   ##
===========================================
+ Coverage     84.86%   85.1%   +0.24%     
+ Complexity      907     902       -5     
===========================================
  Files           171     171              
  Lines          2557    2558       +1     
  Branches        393     395       +2     
===========================================
+ Hits           2170    2177       +7     
+ Misses          151     149       -2     
+ Partials        236     232       -4
Impacted Files Coverage Δ Complexity Δ
...zally/rule/zalando/Use429HeaderForRateLimitRule.kt 62.5% <0%> (-12.5%) 12 <9> (ø)
...do/zally/rule/zalando/PascalCaseHttpHeadersRule.kt 100% <100%> (ø) 5 <5> (ø) ⬇️
...src/main/java/de/zalando/zally/util/OpenApiUtil.kt 76.27% <71.42%> (+15.92%) 0 <0> (ø) ⬇️
...main/java/de/zalando/zally/rule/HttpHeadersRule.kt 82.35% <0%> (-11.77%) 8% <0%> (-5%)

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 cae0423...5f4b356. Read the comment docs.

val swagger = swaggerWithHeaderParams("Right-Name")
assertThat(rule.validate(swagger)).isNull()
}
fun `checkHttpHeaders should return violation if not pascal case is used`() {
Copy link
Member

Choose a reason for hiding this comment

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

This one negative check is definitely not enough as long as we do not have tests for de.zalando.zally.util.OpenApiUtil.kt. We need to add a check for each potential header location, to make sure that we do not miss one. Anyhow, I would prefer similar unit tests on de.zalando.zally.util.OpenApiUtil.kt.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, we should unit test OpenApiUtil class. I'll implement the tests.

@maxim-tschumak maxim-tschumak force-pushed the 714-migrate-pascal-case-headers-rule branch from 7b58681 to 3073b8f Compare September 5, 2018 11:35
@tkrop
Copy link
Member

tkrop commented Sep 10, 2018

👍

@maxim-tschumak maxim-tschumak force-pushed the 714-migrate-pascal-case-headers-rule branch from 5f4b356 to 552cc17 Compare September 10, 2018 12:01
@maxim-tschumak
Copy link
Contributor Author

@tkrop please re-review, the improvements have been implemented

@tkrop
Copy link
Member

tkrop commented Sep 11, 2018

👍

1 similar comment
@maxim-tschumak
Copy link
Contributor Author

👍

@maxim-tschumak maxim-tschumak merged commit dfa54fe into master Sep 11, 2018
@maxim-tschumak maxim-tschumak deleted the 714-migrate-pascal-case-headers-rule branch September 11, 2018 07:25
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.

None yet

3 participants