-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Introduce TestRestTemplate Kotlin extensions #11039
Introduce TestRestTemplate Kotlin extensions #11039
Conversation
@@ -229,6 +229,25 @@ | |||
<artifactId>zt-zip</artifactId> | |||
<version>1.7</version> | |||
</dependency> | |||
<dependency> |
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.
Dependencies are (meant to be) ordered alphabetically. Can you please rework this?
@@ -196,6 +211,38 @@ | |||
</execution> | |||
</executions> | |||
</plugin> | |||
<plugin> |
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.
I am confused. In the spring-boot
module you've set the maven compiler phases to none
. Why isn't it necessary here?
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.
Good catch, it is, I will update the PR accordingly.
@snicoll I have pushed an updated commit with your feedback taken in account. |
Thanks @sdeleuze. One more thing: we have a test that validates that our |
@snicoll In Java, the test uses reflection to list all |
@sdeleuze Perhaps we could do a similar but less extensive check? It would at least be nice to have a test that verifies that we have a top-level function for each method, even if the test doesn't invoke the function. I am working on the perhaps naive assumption that Kotlin is compiled to byte code so we must be able to introspect that byte code… |
@wilkinsona But we don't have 1 extension for each method, we only provide the relevant ones. |
Sorry, "each method" was a little imprecise. I should have written "each method that's relevant". Assuming that we can identify a relevant method programatically, my hope is that it would be possible to test that there's a corresponding top-level function for that method. |
This commit introduces Kotlin extensions similar to the RestOperations ones in order to be able to take advantage of Kotlin reified type parameters for example. Fixes gh-8062
@snicoll @wilkinsona I have been able to create such test using a mix of Java and Kotlin reflection. It allowed to find 5 missing extensions, thanks for pushing for this ;-) I have added the missing extensions to this PR and to Spring Framework 5.0.2 as well via SPR-16229. Can you please merge this commit in order to be included as part of |
Sébastien shared he'd like to use that feature during an upcoming workshop. |
This commit introduces Kotlin extensions similar to the RestOperations ones in order to be able to take advantage of Kotlin reified type parameters for example. See gh-11039
* pr/11039: Polish "Introduce TestRestTemplate Kotlin extensions" Introduce TestRestTemplate Kotlin extensions
This commit introduces Kotlin extensions similar to the
RestOperations
ones in order to be able to take advantage of Kotlin reified type parameters for example.Fixes gh-8062