diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/setup/StandaloneMockMvcBuilder.java b/spring-test/src/main/java/org/springframework/test/web/servlet/setup/StandaloneMockMvcBuilder.java index bf965cca42..a57a84d7f6 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/setup/StandaloneMockMvcBuilder.java +++ b/spring-test/src/main/java/org/springframework/test/web/servlet/setup/StandaloneMockMvcBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 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. @@ -119,7 +119,7 @@ public class StandaloneMockMvcBuilder extends AbstractMockMvcBuilder placeHolderValues = new HashMap(); + private Map placeholderValues = new HashMap(); /** @@ -317,9 +317,19 @@ public class StandaloneMockMvcBuilder extends AbstractMockMvcBuilder initViewResolvers(WebApplicationContext wac) { - this.viewResolvers = (this.viewResolvers == null) ? - Arrays.asList(new InternalResourceViewResolver()) : this.viewResolvers; + this.viewResolvers = (this.viewResolvers != null ? this.viewResolvers : + Collections.singletonList(new InternalResourceViewResolver())); for (Object viewResolver : this.viewResolvers) { if (viewResolver instanceof WebApplicationObjectSupport) { ((WebApplicationObjectSupport) viewResolver).setApplicationContext(wac); @@ -380,7 +390,7 @@ public class StandaloneMockMvcBuilder extends AbstractMockMvcBuilder