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

[116] New @ClientHeaderParam annotation and TCK tests #143

Merged
merged 2 commits into from
Jan 4, 2019

Conversation

andymc12
Copy link
Contributor

Includes spec document changes describing how to use @ClientHeaderParam, the annotation in the API (including javadoc) and TCK tests that test proper usage and exception conditions.

Signed-off-by: Andy McCright j.andrew.mccright@gmail.com

@andymc12 andymc12 added this to the 1.2 milestone Dec 13, 2018
@andymc12 andymc12 self-assigned this Dec 13, 2018
@andymc12
Copy link
Contributor Author

This is part 1 of the solution for issue #116.

@andymc12
Copy link
Contributor Author

@kenfinnigan @michalszynkiewicz - can you take another look at this PR? I've updated it with the review comments, including:
- Highlighting required attribute behavior
- Making value attribute a String[]
- Enabling compute method to be from a different class
- Validation failure if same header specified twice on same target

Thanks!

return "should not be invoked - unexpected Integer arg";
}

default String invalidMethod(ClientRequestContext context, ClientRequestContext someOtherArg) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it work with single ClientRequestContext? This tests seems to suggest so (and I think it may be beneficial in some cases).
I cannot find a test that would check it and the documentation doesn't seem to mention it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was originally thinking that we could pass in a ClientRequestContext in addition the header name, but ultimately decided against it since a lot of the info in CRC would be invalid (or at least, not yet determined this early in the flow).

I should remove that method from the TCK interface.

Is there anything in particular that you thought might be useful from the CRC? We could possibly pass in the Method object from the client interface - that might allow compute methods to read other annotations, etc to better determine what the header value should be...

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't have anything specific in mind.

Signed-off-by: Andy McCright <j.andrew.mccright@gmail.com>
- Highlighting `required` attribute behavior
- Making `value` attribute a String[]
- Enabling compute method to be from a different class
- Validation failure if same header specified twice on same target

Signed-off-by: Andy McCright <j.andrew.mccright@gmail.com>
@andymc12
Copy link
Contributor Author

@michalszynkiewicz I updated the Javadoc to be consistent with the spec text to indicate that the compute method can be either a default method on the interface or a public static method on another class/interface. And I added a new test for cases where multiple values were specified on the same annotation and at least one uses the curly braces. Thanks again for the review!

@andymc12
Copy link
Contributor Author

andymc12 commented Jan 3, 2019

@kenfinnigan I assume you are ok with the latest changes (based on discussion in gitter from a couple weeks ago). I'll plan to merge tomorrow unless you have any objections. Thanks (and Happy New Year)!

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