class MockServerContainerContextCustomizerFactory extends java.lang.Object implements ContextCustomizerFactory
ContextCustomizerFactory
which creates a MockServerContainerContextCustomizer
if WebSocket support is present in the classpath and the test class is annotated
with @WebAppConfiguration
.Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
MOCK_SERVER_CONTAINER_CONTEXT_CUSTOMIZER_CLASS_NAME |
private static java.lang.String |
WEB_APP_CONFIGURATION_ANNOTATION_CLASS_NAME |
private static boolean |
webSocketPresent |
Constructor and Description |
---|
MockServerContainerContextCustomizerFactory() |
Modifier and Type | Method and Description |
---|---|
ContextCustomizer |
createContextCustomizer(java.lang.Class<?> testClass,
java.util.List<ContextConfigurationAttributes> configAttributes)
Create a
ContextCustomizer that should be used to customize a
ConfigurableApplicationContext
before it is refreshed. |
private static boolean |
isAnnotatedWithWebAppConfiguration(java.lang.Class<?> testClass) |
private static final java.lang.String WEB_APP_CONFIGURATION_ANNOTATION_CLASS_NAME
private static final java.lang.String MOCK_SERVER_CONTAINER_CONTEXT_CUSTOMIZER_CLASS_NAME
private static final boolean webSocketPresent
MockServerContainerContextCustomizerFactory()
public ContextCustomizer createContextCustomizer(java.lang.Class<?> testClass, java.util.List<ContextConfigurationAttributes> configAttributes)
ContextCustomizerFactory
ContextCustomizer
that should be used to customize a
ConfigurableApplicationContext
before it is refreshed.createContextCustomizer
in interface ContextCustomizerFactory
testClass
- the test classconfigAttributes
- the list of context configuration attributes for
the test class, ordered bottom-up (i.e., as if we were traversing
up the class hierarchy); never null
or emptyContextCustomizer
or null
if no customizer should
be usedprivate static boolean isAnnotatedWithWebAppConfiguration(java.lang.Class<?> testClass)