This commit is contained in:
Phillip Webb
2019-04-11 13:39:26 -07:00
parent dabe75a281
commit 2dfd916c96
34 changed files with 517 additions and 451 deletions

View File

@@ -77,6 +77,8 @@ import org.springframework.web.context.support.GenericWebApplicationContext;
*/
public class SpringBootContextLoader extends AbstractContextLoader {
private static final String[] NO_ARGS = new String[0];
@Override
public ApplicationContext loadContext(MergedContextConfiguration config)
throws Exception {
@@ -155,7 +157,7 @@ public class SpringBootContextLoader extends AbstractContextLoader {
protected String[] getArgs(MergedContextConfiguration config) {
SpringBootTest annotation = AnnotatedElementUtils
.findMergedAnnotation(config.getTestClass(), SpringBootTest.class);
return (annotation != null) ? annotation.args() : new String[0];
return (annotation != null) ? annotation.args() : NO_ARGS;
}
private void setActiveProfiles(ConfigurableEnvironment environment,