Use single String instead of String[] for varargs argument

Closes gh-24864
This commit is contained in:
Qimiao Chen
2020-04-05 02:05:19 +08:00
committed by GitHub
parent 251501587b
commit fd8d11c7e3

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 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.
@@ -55,7 +55,7 @@ public class XmlWebApplicationContextTests extends AbstractApplicationContextTes
root.getEnvironment().addActiveProfile("rootProfile1");
MockServletContext sc = new MockServletContext("");
root.setServletContext(sc);
root.setConfigLocations(new String[] {"/org/springframework/web/context/WEB-INF/applicationContext.xml"});
root.setConfigLocations("/org/springframework/web/context/WEB-INF/applicationContext.xml");
root.addBeanFactoryPostProcessor(new BeanFactoryPostProcessor() {
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
@@ -80,7 +80,7 @@ public class XmlWebApplicationContextTests extends AbstractApplicationContextTes
wac.setParent(root);
wac.setServletContext(sc);
wac.setNamespace("test-servlet");
wac.setConfigLocations(new String[] {"/org/springframework/web/context/WEB-INF/test-servlet.xml"});
wac.setConfigLocations("/org/springframework/web/context/WEB-INF/test-servlet.xml");
wac.refresh();
return wac;
}
@@ -120,7 +120,7 @@ public class XmlWebApplicationContextTests extends AbstractApplicationContextTes
wac.setParent(root);
wac.setServletContext(sc);
wac.setNamespace("testNamespace");
wac.setConfigLocations(new String[] {"/org/springframework/web/context/WEB-INF/test-servlet.xml"});
wac.setConfigLocations("/org/springframework/web/context/WEB-INF/test-servlet.xml");
wac.refresh();
assertThatExceptionOfType(NoSuchMessageException.class).isThrownBy(() ->
wac.getMessage("someMessage", null, Locale.getDefault()));