Package org.springframework.test.context.aot

# Class AotTestContextInitializers

java.lang.Object
org.springframework.test.context.aot.AotTestContextInitializers

public class AotTestContextInitializers extends Object
`AotTestContextInitializers` provides mappings from test classes to AOT-optimized context initializers.

Intended solely for internal use within the framework.

If we are not running in AOT mode or if a test class is not supported in AOT mode, `getContextInitializer(Class)` and `getContextInitializerClass(Class)` will return `null`.

Since:
  6.0
Author:
  Sam Brannen

## Constructor Summary

Constructors
Constructor
Description
`AotTestContextInitializers()`

## Method Summary

Modifier and Type
Method
Description
`org.springframework.context.ApplicationContextInitializer<org.springframework.context.ConfigurableApplicationContext>`
`getContextInitializer(Class<?> testClass)`
Get the AOT `ApplicationContextInitializer` for the specified test class.
`Class<org.springframework.context.ApplicationContextInitializer<?>>`
`getContextInitializerClass(Class<?> testClass)`
Get the AOT `ApplicationContextInitializer` `Class` for the specified test class.
`boolean`
`isSupportedTestClass(Class<?> testClass)`
Determine if the specified test class has an AOT-optimized application context initializer.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### AotTestContextInitializers

public AotTestContextInitializers()

## Method Details

### isSupportedTestClass

public boolean isSupportedTestClass(Class<?> testClass)
Determine if the specified test class has an AOT-optimized application context initializer.

If this method returns `true`, `getContextInitializer(Class)` should not return `null`.

### getContextInitializer

@Nullable public org.springframework.context.ApplicationContextInitializer<org.springframework.context.ConfigurableApplicationContext> getContextInitializer(Class<?> testClass)
Get the AOT `ApplicationContextInitializer` for the specified test class.

Returns:
  the AOT context initializer, or `null` if there is no AOT context initializer for the specified test class
See Also:
  - `isSupportedTestClass(Class)`
  - `getContextInitializerClass(Class)`

### getContextInitializerClass

@Nullable public Class<org.springframework.context.ApplicationContextInitializer<?>> getContextInitializerClass(Class<?> testClass)
Get the AOT `ApplicationContextInitializer` `Class` for the specified test class.

Returns:
  the AOT context initializer class, or `null` if there is no AOT context initializer for the specified test class
See Also:
  - `isSupportedTestClass(Class)`
  - `getContextInitializer(Class)`