Consistent spelling for StandaloneMockMvcBuilder's addPlaceholderValue
This commit is contained in:
@@ -119,7 +119,7 @@ public class StandaloneMockMvcBuilder extends AbstractMockMvcBuilder<StandaloneM
|
||||
|
||||
private Boolean removeSemicolonContent;
|
||||
|
||||
private Map<String, String> placeHolderValues = new HashMap<>();
|
||||
private Map<String, String> placeholderValues = new HashMap<>();
|
||||
|
||||
|
||||
/**
|
||||
@@ -317,9 +317,10 @@ public class StandaloneMockMvcBuilder extends AbstractMockMvcBuilder<StandaloneM
|
||||
* request mappings. This method allows manually provided placeholder values so they
|
||||
* can be resolved. Alternatively consider creating a test that initializes a
|
||||
* {@link WebApplicationContext}.
|
||||
* @since 4.2.8
|
||||
*/
|
||||
public StandaloneMockMvcBuilder addPlaceHolderValue(String name, String value) {
|
||||
this.placeHolderValues.put(name, value);
|
||||
public StandaloneMockMvcBuilder addPlaceholderValue(String name, String value) {
|
||||
this.placeholderValues.put(name, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -364,8 +365,8 @@ public class StandaloneMockMvcBuilder extends AbstractMockMvcBuilder<StandaloneM
|
||||
}
|
||||
|
||||
private List<ViewResolver> initViewResolvers(WebApplicationContext wac) {
|
||||
this.viewResolvers = (this.viewResolvers == null) ?
|
||||
Arrays.<ViewResolver>asList(new InternalResourceViewResolver()) : this.viewResolvers;
|
||||
this.viewResolvers = (this.viewResolvers != null ? this.viewResolvers :
|
||||
Collections.<ViewResolver>singletonList(new InternalResourceViewResolver()));
|
||||
for (Object viewResolver : this.viewResolvers) {
|
||||
if (viewResolver instanceof WebApplicationObjectSupport) {
|
||||
((WebApplicationObjectSupport) viewResolver).setApplicationContext(wac);
|
||||
@@ -380,7 +381,7 @@ public class StandaloneMockMvcBuilder extends AbstractMockMvcBuilder<StandaloneM
|
||||
|
||||
public StaticRequestMappingHandlerMapping getHandlerMapping() {
|
||||
StaticRequestMappingHandlerMapping handlerMapping = new StaticRequestMappingHandlerMapping();
|
||||
handlerMapping.setEmbeddedValueResolver(new StaticStringValueResolver(placeHolderValues));
|
||||
handlerMapping.setEmbeddedValueResolver(new StaticStringValueResolver(placeholderValues));
|
||||
handlerMapping.setUseSuffixPatternMatch(useSuffixPatternMatch);
|
||||
handlerMapping.setUseTrailingSlashMatch(useTrailingSlashPatternMatch);
|
||||
handlerMapping.setOrder(0);
|
||||
@@ -440,8 +441,8 @@ public class StandaloneMockMvcBuilder extends AbstractMockMvcBuilder<StandaloneM
|
||||
try {
|
||||
((InitializingBean) mvcValidator).afterPropertiesSet();
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new BeanInitializationException("Failed to initialize Validator", e);
|
||||
catch (Exception ex) {
|
||||
throw new BeanInitializationException("Failed to initialize Validator", ex);
|
||||
}
|
||||
}
|
||||
return mvcValidator;
|
||||
|
||||
Reference in New Issue
Block a user