Skip to content

Commit 64c96c5

Browse files
committed
Polish contribution
See gh-28422
1 parent 39e3876 commit 64c96c5

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ErrorsMethodArgumentResolver.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,7 +33,8 @@
3333

3434
/**
3535
* Resolve {@link Errors} or {@link BindingResult} method arguments.
36-
* An {@code Errors} argument is expected to appear immediately after the
36+
*
37+
* <p>An {@code Errors} argument is expected to appear immediately after the
3738
* model attribute in the method signature.
3839
*
3940
* @author Rossen Stoyanchev

spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/ErrorsMethodArgumentResolverTests.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -82,12 +82,11 @@ void resolve() {
8282
}
8383

8484
@Test
85-
void resolveOnBindingResultAndModelAttributeWithCustomValue() {
85+
void resolveOnBindingResultAndModelAttributeWithCustomName() {
8686
BindingResult bindingResult = createBindingResult(new Foo(), "custom");
8787
this.bindingContext.getModel().asMap().put(BindingResult.MODEL_KEY_PREFIX + "custom", bindingResult);
8888

89-
ResolvableMethod testMethod = ResolvableMethod.on(getClass())
90-
.named("handleWithModelAttributeValue").build();
89+
ResolvableMethod testMethod = ResolvableMethod.on(getClass()).named("handleWithCustomModelAttributeName").build();
9190

9291
MethodParameter parameter = testMethod.arg(Errors.class);
9392
Object actual = this.resolver.resolveArgument(parameter, this.bindingContext, this.exchange)
@@ -114,12 +113,11 @@ void resolveWithMono() {
114113
}
115114

116115
@Test
117-
void resolveWithMonoOnBindingResultAndModelAttributeWithCustomValue() {
116+
void resolveWithMonoOnBindingResultAndModelAttributeWithCustomName() {
118117
BindingResult bindingResult = createBindingResult(new Foo(), "custom");
119118
this.bindingContext.getModel().asMap().put(BindingResult.MODEL_KEY_PREFIX + "custom", Mono.just(bindingResult));
120119

121-
ResolvableMethod testMethod = ResolvableMethod.on(getClass())
122-
.named("handleWithModelAttributeValue").build();
120+
ResolvableMethod testMethod = ResolvableMethod.on(getClass()).named("handleWithCustomModelAttributeName").build();
123121

124122
MethodParameter parameter = testMethod.arg(Errors.class);
125123
Object actual = this.resolver.resolveArgument(parameter, this.bindingContext, this.exchange)
@@ -181,12 +179,13 @@ void handle(
181179
}
182180

183181
@SuppressWarnings("unused")
184-
void handleWithModelAttributeValue(
182+
void handleWithCustomModelAttributeName(
185183
@ModelAttribute("custom") Foo foo,
186184
Errors errors,
187185
@ModelAttribute Mono<Foo> fooMono,
188186
BindingResult bindingResult,
189187
Mono<Errors> errorsMono,
190188
String string) {
191189
}
190+
192191
}

0 commit comments

Comments
 (0)