diff --git a/spring-test/src/main/java/org/springframework/test/context/support/AbstractGenericContextLoader.java b/spring-test/src/main/java/org/springframework/test/context/support/AbstractGenericContextLoader.java index 8cefc456fb0..b2ea37b9fec 100644 --- a/spring-test/src/main/java/org/springframework/test/context/support/AbstractGenericContextLoader.java +++ b/spring-test/src/main/java/org/springframework/test/context/support/AbstractGenericContextLoader.java @@ -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. @@ -70,7 +70,8 @@ public abstract class AbstractGenericContextLoader extends AbstractContextLoader *
Implementation details: * *
The default implementation creates a {@code GenericApplicationContext} + * using the default constructor. This method may be overridden in subclasses + * — for example, to create a {@code GenericApplicationContext} with + * a custom {@link DefaultListableBeanFactory} implementation. + * + * @return a newly instantiated {@code GenericApplicationContext} + * @since 5.2.9 + */ + protected GenericApplicationContext createContext() { + return new GenericApplicationContext(); + } + /** * Prepare the {@link GenericApplicationContext} created by this {@code ContextLoader}. * Called before bean definitions are read. diff --git a/spring-test/src/main/java/org/springframework/test/context/support/GenericGroovyXmlContextLoader.java b/spring-test/src/main/java/org/springframework/test/context/support/GenericGroovyXmlContextLoader.java index 9a46a070ea4..86dc00da948 100644 --- a/spring-test/src/main/java/org/springframework/test/context/support/GenericGroovyXmlContextLoader.java +++ b/spring-test/src/main/java/org/springframework/test/context/support/GenericGroovyXmlContextLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 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. @@ -49,7 +49,7 @@ public class GenericGroovyXmlContextLoader extends GenericXmlContextLoader { } /** - * Returns {@code "-context.xml" and "Context.groovy"} in order to + * Returns {@code "-context.xml"} and {@code "Context.groovy"} in order to * support detection of a default XML config file or Groovy script. */ @Override