Skip to content

Commit 8baeca5

Browse files
committed
Simplifies ProxyingHandlerMethodArgumentResolverUnitTests
- clarifies controller method names - groups test methods by what they are doing See #3301
1 parent a1b7c1a commit 8baeca5

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

src/test/java/org/springframework/data/web/ProxyingHandlerMethodArgumentResolverUnitTests.java

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -55,31 +55,31 @@ class ProxyingHandlerMethodArgumentResolverUnitTests {
5555
@Test // DATACMNS-776
5656
void supportsAnnotatedInterfaceFromSpringNamespace() {
5757

58-
var parameter = getParameter("with", AnnotatedInterface.class);
58+
var parameter = getParameter("withSpringAnnotatedInterface");
5959

6060
assertThat(resolver.supportsParameter(parameter)).isTrue();
6161
}
6262

63-
@Test // GH-3301
64-
void supportsAnnotatedInterfaceFromUserPackage() {
63+
@Test // DATACMNS-776
64+
void doesNotSupportUnannotatedInterfaceFromSpringNamespace() {
6565

66-
var parameter = getParameter("with", ProjectedPayloadMarkedSampleInterface.class);
66+
var parameter = getParameter("withSpringUnannotatedInterface");
6767

68-
assertThat(resolver.supportsParameter(parameter)).isTrue();
68+
assertThat(resolver.supportsParameter(parameter)).isFalse();
6969
}
7070

7171
@Test // GH-3301
72-
void doesNotSupportUnannotatedInterfaceFromUserPackage() {
72+
void supportsAnnotatedInterfaceFromUserPackage() {
7373

74-
var parameter = getParameter("with", SampleInterface.class);
74+
var parameter = getParameter("withUserAnnotatedInterface");
7575

76-
assertThat(resolver.supportsParameter(parameter)).isFalse();
76+
assertThat(resolver.supportsParameter(parameter)).isTrue();
7777
}
7878

79-
@Test // DATACMNS-776
80-
void doesNotSupportUnannotatedInterfaceFromSpringNamespace() {
79+
@Test // GH-3301
80+
void doesNotSupportUnannotatedInterfaceFromUserPackage() {
8181

82-
var parameter = getParameter("with", UnannotatedInterface.class);
82+
var parameter = getParameter("withUserUnannotatedInterface");
8383

8484
assertThat(resolver.supportsParameter(parameter)).isFalse();
8585
}
@@ -133,7 +133,7 @@ void doesNotSupportAtProjectedPayloadForMultipartParam() {
133133
}
134134

135135
@ParameterizedTest // GH-3300
136-
@ValueSource(strings = { "withModelAttribute", "withUnannotatedInterface" })
136+
@ValueSource(strings = { "withModelAttribute", "withUserUnannotatedInterface" })
137137
@SuppressWarnings("unchecked")
138138
void deprecationLoggerOnlyLogsOncePerParameter(String methodName) {
139139

@@ -152,7 +152,7 @@ void deprecationLoggerOnlyLogsOncePerParameter(String methodName) {
152152
}
153153

154154
@ParameterizedTest // GH-3300
155-
@ValueSource(strings = { "withProjectedPayload", "withAnnotatedInterface" })
155+
@ValueSource(strings = { "withProjectedPayload", "withSpringAnnotatedInterface", "withUserAnnotatedInterface" })
156156
void shouldNotLogDeprecationForValidUsage(String methodName) {
157157

158158
var parameter = getParameter(methodName);
@@ -192,17 +192,13 @@ interface UnannotatedInterface {}
192192

193193
interface Controller {
194194

195-
void with(AnnotatedInterface param);
196-
197-
void withAnnotatedInterface(@ModelAttribute AnnotatedInterface param);
198-
199-
void with(UnannotatedInterface param);
195+
void withSpringAnnotatedInterface(AnnotatedInterface param);
200196

201-
void with(SampleInterface param);
197+
void withSpringUnannotatedInterface(UnannotatedInterface param);
202198

203-
void with(ProjectedPayloadMarkedSampleInterface param);
199+
void withUserAnnotatedInterface(ProjectedPayloadMarkedSampleInterface param);
204200

205-
void withUnannotatedInterface(SampleInterface param);
201+
void withUserUnannotatedInterface(SampleInterface param);
206202

207203
void with(List<Object> param);
208204

0 commit comments

Comments
 (0)