-
Notifications
You must be signed in to change notification settings - Fork 595
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
Both assertHeaderExists functions now behave in the same way. #323
Conversation
Can one of the repo owners verify this patch? |
BTW, it's #5. |
This does not solve #5 though? I was about making the error message show what headers were available in addition to saying what was missing. |
OK TO TEST |
Test PASSed. |
Another |
Please mention such things in PRs ;) It's non obvious to see from the changes made that now it's supposed to work as intended |
LGTM |
Uh, sorry. Will do in future. |
Thanks for the PR! Even more important than the PR text is the commit message. If it resolves #5, mention it in the message. And be specific: rather than saying "in the same way", explain what that way is. That way, anyone browsing the code at a future point in time can immediately see the intentions, without having to do further digging. |
Test PASSed. |
Test PASSed. |
Thanks for the feedback! I've improved the commit message. |
Commit message now has a typo (too many 's' in 'missing') :) And "misssing header name or values not matching assertion are not logged"? Isn't the whole point that they now are logged? |
Pardon my absentmindedness... |
Thanks @rbudzko. Great change. |
Test FAILed. |
is that even related to the change? |
@@ -207,8 +199,8 @@ abstract class TestRouteResult(_result: RouteResult, awaitAtMost: FiniteDuration | |||
* Assert that a header of the given name and value exists. | |||
*/ | |||
def assertHeaderExists(name: String, value: String): TestRouteResult = { | |||
val lowercased = name.toRootLowerCase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was intentional. Otherwise, the function given to the filter will call name.toRootLowerCase
for every header during the iteration.
/** | ||
* Assert that a given header instance exists in the response. | ||
*/ | ||
def assertHeaderExists(expected: HttpHeader): TestRouteResult = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove the braces? Thanks ;)
…ation about missing header name or values not matching assertion are logged. Addresses (#5).
Test PASSed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @rbudzko! I'd kepp the first line short:
assertHeaderExists functions now behave in the same way (#5)
information about missing header name or values not matching assertion are logged.
But we can fix that while merging.
@akka/akka-http-team Do we have a policy re. commit msgs yet?
I'd say we try to keep the akka one for consistency. |
Thx @rbudzko! |
|
While not sure if it is a desired behavior, I'd like to propose such a change 😇 .