Polishing

This commit is contained in:
Sam Brannen
2022-11-04 16:03:47 +01:00
parent 638d91f5f4
commit a281d8c3fd
12 changed files with 27 additions and 28 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 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.
@@ -449,7 +449,7 @@ public class MvcUriComponentsBuilder {
*/
public static MethodArgumentBuilder fromMappingName(@Nullable UriComponentsBuilder builder, String name) {
WebApplicationContext wac = getWebApplicationContext();
Assert.notNull(wac, "No WebApplicationContext. ");
Assert.notNull(wac, "No WebApplicationContext");
Map<String, RequestMappingInfoHandlerMapping> map = wac.getBeansOfType(RequestMappingInfoHandlerMapping.class);
List<HandlerMethod> handlerMethods = null;
for (RequestMappingInfoHandlerMapping mapping : map.values()) {

View File

@@ -16,7 +16,6 @@
package org.springframework.web.servlet.mvc.method.annotation;
import java.io.IOException;
import java.io.OutputStream;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 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.
@@ -258,12 +258,12 @@ public class ScriptTemplateView extends AbstractUrlBasedView {
engineCount++;
}
Assert.isTrue(engineCount == 1,
"You should define either 'engine', 'engineSupplier' or 'engineName'.");
"You should define either 'engine', 'engineSupplier', or 'engineName'.");
if (Boolean.FALSE.equals(this.sharedEngine)) {
Assert.isTrue(this.engine == null,
"When 'sharedEngine' is set to false, you should specify the " +
"script engine using 'engineName' or 'engineSupplier' , not 'engine'.");
"script engine using 'engineName' or 'engineSupplier', not 'engine'.");
}
else if (this.engine != null) {
loadScripts(this.engine);

View File

@@ -189,7 +189,7 @@ public class ScriptTemplateViewTests {
this.view.setRenderFunction("render");
assertThatIllegalArgumentException().isThrownBy(() ->
this.view.setApplicationContext(this.wac))
.withMessageContaining("You should define either 'engine', 'engineSupplier' or 'engineName'.");
.withMessageContaining("You should define either 'engine', 'engineSupplier', or 'engineName'.");
}
@Test // gh-23258
@@ -200,7 +200,7 @@ public class ScriptTemplateViewTests {
this.view.setRenderFunction("render");
assertThatIllegalArgumentException().isThrownBy(() ->
this.view.setApplicationContext(this.wac))
.withMessageContaining("You should define either 'engine', 'engineSupplier' or 'engineName'.");
.withMessageContaining("You should define either 'engine', 'engineSupplier', or 'engineName'.");
}
@Test // gh-23258
@@ -210,7 +210,7 @@ public class ScriptTemplateViewTests {
this.view.setRenderFunction("render");
assertThatIllegalArgumentException().isThrownBy(() ->
this.view.setApplicationContext(this.wac))
.withMessageContaining("You should define either 'engine', 'engineSupplier' or 'engineName'.");
.withMessageContaining("You should define either 'engine', 'engineSupplier', or 'engineName'.");
}
@Test