Class ApplicationContextRunner
java.lang.Object
org.springframework.boot.test.context.runner.AbstractApplicationContextRunner<ApplicationContextRunner,org.springframework.context.ConfigurableApplicationContext,AssertableApplicationContext>
org.springframework.boot.test.context.runner.ApplicationContextRunner
public class ApplicationContextRunner
extends AbstractApplicationContextRunner<ApplicationContextRunner,org.springframework.context.ConfigurableApplicationContext,AssertableApplicationContext>
An
ApplicationContext runner
for a standard,
non-web environment ConfigurableApplicationContext
.
See AbstractApplicationContextRunner
for details.
- Since:
- 2.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.boot.test.context.runner.AbstractApplicationContextRunner
AbstractApplicationContextRunner.BeanRegistration<T>, AbstractApplicationContextRunner.RunnerConfiguration<C extends org.springframework.context.ConfigurableApplicationContext>
-
Constructor Summary
ConstructorDescriptionCreate a newApplicationContextRunner
instance using anAnnotationConfigApplicationContext
as the underlying source.ApplicationContextRunner
(Supplier<org.springframework.context.ConfigurableApplicationContext> contextFactory) Create a newApplicationContextRunner
instance using the specifiedcontextFactory
as the underlying source. -
Method Summary
Methods inherited from class org.springframework.boot.test.context.runner.AbstractApplicationContextRunner
prepare, run, with, withAllowBeanDefinitionOverriding, withAllowCircularReferences, withBean, withBean, withBean, withBean, withClassLoader, withConfiguration, withInitializer, withParent, withPropertyValues, withSystemProperties, withUserConfiguration
-
Constructor Details
-
ApplicationContextRunner
public ApplicationContextRunner()Create a newApplicationContextRunner
instance using anAnnotationConfigApplicationContext
as the underlying source. -
ApplicationContextRunner
public ApplicationContextRunner(Supplier<org.springframework.context.ConfigurableApplicationContext> contextFactory) Create a newApplicationContextRunner
instance using the specifiedcontextFactory
as the underlying source.- Parameters:
contextFactory
- a supplier that returns a new instance on each call
-