Skip to content

Commit

Permalink
Polishing.
Browse files Browse the repository at this point in the history
Related ticket GH-2937.
  • Loading branch information
odrotbohm committed Aug 28, 2024
1 parent 480aa52 commit 32d2e5f
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,43 +35,39 @@
* @soundtrack Karlijn Langendijk & Sönke Meinen - Englishman In New York (Sting,
* https://www.youtube.com/watch?v=O7LZsqrnaaA)
*/
public class ProxyingHandlerMethodArgumentResolverUnitTests {
class ProxyingHandlerMethodArgumentResolverUnitTests {

ProxyingHandlerMethodArgumentResolver resolver = new ProxyingHandlerMethodArgumentResolver(
() -> new DefaultConversionService(), true);

@Test // DATACMNS-776
void supportAnnotatedInterface() throws Exception {

var method = Controller.class.getMethod("with", AnnotatedInterface.class);
var parameter = new MethodParameter(method, 0);
var parameter = getParameter("with", AnnotatedInterface.class);

assertThat(resolver.supportsParameter(parameter)).isTrue();
}

@Test // DATACMNS-776
void supportsUnannotatedInterfaceFromUserPackage() throws Exception {

var method = Controller.class.getMethod("with", SampleInterface.class);
var parameter = new MethodParameter(method, 0);
var parameter = getParameter("with", SampleInterface.class);

assertThat(resolver.supportsParameter(parameter)).isTrue();
}

@Test // DATACMNS-776
void doesNotSupportUnannotatedInterfaceFromSpringNamespace() throws Exception {

var method = Controller.class.getMethod("with", UnannotatedInterface.class);
var parameter = new MethodParameter(method, 0);
var parameter = getParameter("with", UnannotatedInterface.class);

assertThat(resolver.supportsParameter(parameter)).isFalse();
}

@Test // DATACMNS-776
void doesNotSupportCoreJavaType() throws Exception {

var method = Controller.class.getMethod("with", List.class);
var parameter = new MethodParameter(method, 0);
var parameter = getParameter("with", List.class);

assertThat(resolver.supportsParameter(parameter)).isFalse();
}
Expand Down

0 comments on commit 32d2e5f

Please sign in to comment.