Class SpringBootTestContextBootstrapper

    • Method Detail

      • buildTestContext

        public org.springframework.test.context.TestContext buildTestContext()
        Specified by:
        buildTestContext in interface org.springframework.test.context.TestContextBootstrapper
        Overrides:
        buildTestContext in class org.springframework.test.context.support.AbstractTestContextBootstrapper
      • getDefaultTestExecutionListenerClasses

        protected Set<Class<? extends org.springframework.test.context.TestExecutionListener>> getDefaultTestExecutionListenerClasses()
        Overrides:
        getDefaultTestExecutionListenerClasses in class org.springframework.test.context.support.AbstractTestContextBootstrapper
      • resolveContextLoader

        protected org.springframework.test.context.ContextLoader resolveContextLoader​(Class<?> testClass,
                                                                                      List<org.springframework.test.context.ContextConfigurationAttributes> configAttributesList)
        Overrides:
        resolveContextLoader in class org.springframework.test.context.support.AbstractTestContextBootstrapper
      • getDefaultContextLoaderClass

        protected Class<? extends org.springframework.test.context.ContextLoader> getDefaultContextLoaderClass​(Class<?> testClass)
        Overrides:
        getDefaultContextLoaderClass in class org.springframework.test.context.support.DefaultTestContextBootstrapper
      • processMergedContextConfiguration

        protected org.springframework.test.context.MergedContextConfiguration processMergedContextConfiguration​(org.springframework.test.context.MergedContextConfiguration mergedConfig)
        Overrides:
        processMergedContextConfiguration in class org.springframework.test.context.support.AbstractTestContextBootstrapper
      • getDifferentiatorPropertySourceProperty

        protected String getDifferentiatorPropertySourceProperty()
        Return a "differentiator" property to ensure that there is something to differentiate regular tests and bootstrapped tests. Without this property a cached context could be returned that wasn't created by this bootstrapper. By default uses the bootstrapper class as a property.
        Returns:
        the differentiator or null
      • processPropertySourceProperties

        protected void processPropertySourceProperties​(org.springframework.test.context.MergedContextConfiguration mergedConfig,
                                                       List<String> propertySourceProperties)
        Post process the property source properties, adding or removing elements as required.
        Parameters:
        mergedConfig - the merged context configuration
        propertySourceProperties - the property source properties to process
      • createModifiedConfig

        protected final org.springframework.test.context.MergedContextConfiguration createModifiedConfig​(org.springframework.test.context.MergedContextConfiguration mergedConfig,
                                                                                                         Class<?>[] classes)
        Create a new MergedContextConfiguration with different classes.
        Parameters:
        mergedConfig - the source config
        classes - the replacement classes
        Returns:
        a new MergedContextConfiguration
      • createModifiedConfig

        protected final org.springframework.test.context.MergedContextConfiguration createModifiedConfig​(org.springframework.test.context.MergedContextConfiguration mergedConfig,
                                                                                                         Class<?>[] classes,
                                                                                                         String[] propertySourceProperties)
        Create a new MergedContextConfiguration with different classes and properties.
        Parameters:
        mergedConfig - the source config
        classes - the replacement classes
        propertySourceProperties - the replacement properties
        Returns:
        a new MergedContextConfiguration