Skip to content

Commit

Permalink
Polish contribution
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed May 7, 2022
1 parent 39e3876 commit 64c96c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -33,7 +33,8 @@

/**
* Resolve {@link Errors} or {@link BindingResult} method arguments.
* An {@code Errors} argument is expected to appear immediately after the
*
* <p>An {@code Errors} argument is expected to appear immediately after the
* model attribute in the method signature.
*
* @author Rossen Stoyanchev
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -82,12 +82,11 @@ void resolve() {
}

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

ResolvableMethod testMethod = ResolvableMethod.on(getClass())
.named("handleWithModelAttributeValue").build();
ResolvableMethod testMethod = ResolvableMethod.on(getClass()).named("handleWithCustomModelAttributeName").build();

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

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

ResolvableMethod testMethod = ResolvableMethod.on(getClass())
.named("handleWithModelAttributeValue").build();
ResolvableMethod testMethod = ResolvableMethod.on(getClass()).named("handleWithCustomModelAttributeName").build();

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

@SuppressWarnings("unused")
void handleWithModelAttributeValue(
void handleWithCustomModelAttributeName(
@ModelAttribute("custom") Foo foo,
Errors errors,
@ModelAttribute Mono<Foo> fooMono,
BindingResult bindingResult,
Mono<Errors> errorsMono,
String string) {
}

}

0 comments on commit 64c96c5

Please sign in to comment.