Class TestUtils
java.lang.Object
org.springframework.integration.test.util.TestUtils
- Author:
- Mark Fisher, Iwein Fuld, Oleg Zhurakousky, Artem Bilan, Gary Russell
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final recordstatic classAGenericApplicationContextextension with some support methods to register Spring Integration beans in the application context at runtime.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic TestUtils.LevelsContaineradjustLogLevels(String methodName, List<Class<?>> classes, List<String> categories, org.apache.logging.log4j.Level level) static StringUpdate file path by replacing any '/' with the system's file separator.static ThreadPoolTaskSchedulercreateTaskScheduler(int poolSize) A factory for theThreadPoolTaskSchedulerinstances based on the providedpoolSize.Create aTestUtils.TestApplicationContextinstance supplied with the basic Spring Integration infrastructure.static @Nullable ObjectgetPropertyValue(Object root, String propertyPath) Obtain a value for the property from the provide object.static <T> @Nullable TgetPropertyValue(Object root, String propertyPath, Class<T> type) Obtain a value for the property from the provide object and try to cast it to the provided type.static @Nullable PropertieslocateComponentInHistory(List<Properties> history, String componentName, int startingIndex) static voidrevertLogLevels(String methodName, TestUtils.LevelsContainer container) 
- 
Constructor Details- 
TestUtilspublic TestUtils()
 
- 
- 
Method Details- 
getPropertyValueObtain a value for the property from the provide object and try to cast it to the provided type. Supports nested properties via period delimiter.- Type Parameters:
- T- the expected value type. Can be nested path defined by the period.
- Parameters:
- root- the object to obtain the property value
- propertyPath- the property name to obtain a value.
- type- the expected value type.
- Returns:
- the value of the property or null
- See Also:
 
- 
getPropertyValueObtain a value for the property from the provide object. Supports nested properties via period delimiter.- Parameters:
- root- the object to obtain the property value
- propertyPath- the property name to obtain a value. Can be nested path defined by the period.
- Returns:
- the value of the property or null
- See Also:
 
- 
createTestApplicationContextCreate aTestUtils.TestApplicationContextinstance supplied with the basic Spring Integration infrastructure.- Returns:
- the TestUtils.TestApplicationContextinstance
 
- 
createTaskSchedulerA factory for theThreadPoolTaskSchedulerinstances based on the providedpoolSize.- Parameters:
- poolSize- the size for the- ThreadPoolTaskScheduler
- Returns:
- the ThreadPoolTaskSchedulerinstance.
 
- 
locateComponentInHistorypublic static @Nullable Properties locateComponentInHistory(List<Properties> history, String componentName, int startingIndex) - Parameters:
- history- a message history
- componentName- the name of a component to scan for
- startingIndex- the index to start scanning
- Returns:
- the properties provided by the named component or null if none available
 
- 
applySystemFileSeparator
- 
adjustLogLevels
- 
revertLogLevels
 
-