Fix SF 4.3.5 Test Compatibility

Default Conversion Service.

a7ba63d425 (diff-d5e8c3a85a50c6752bd812dea2b6d26a)
This commit is contained in:
Gary Russell
2016-12-20 09:19:26 -05:00
parent f7def2d1de
commit 7eeb4e3535
2 changed files with 10 additions and 7 deletions

View File

@@ -135,7 +135,7 @@ subprojects { subproject ->
springSecurityVersion = '4.1.0.RELEASE'
springSocialTwitterVersion = '1.1.2.RELEASE'
springRetryVersion = '1.1.3.RELEASE'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '4.3.4.RELEASE'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '4.3.5.BUILD-SNAPSHOT'
springWsVersion = '2.3.0.RELEASE'
xmlUnitVersion = '1.6'
xstreamVersion = '1.4.7'

View File

@@ -26,6 +26,7 @@ import org.junit.Test;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.support.ConversionServiceFactoryBean;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.core.convert.support.DefaultConversionService;
import org.springframework.expression.TypeConverter;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.integration.config.IntegrationEvaluationContextFactoryBean;
@@ -35,8 +36,8 @@ import org.springframework.integration.test.util.TestUtils;
/**
* @author Gary Russell
* @since 3.0
*
* @since 3.0
*/
public class ExpressionUtilsTests {
@@ -51,8 +52,9 @@ public class ExpressionUtilsTests {
StandardEvaluationContext evalContext = ExpressionUtils.createStandardEvaluationContext(context);
assertNotNull(evalContext.getBeanResolver());
assertNotNull(evalContext.getTypeConverter());
IntegrationEvaluationContextFactoryBean factory = context.getBean("&" + IntegrationContextUtils.INTEGRATION_EVALUATION_CONTEXT_BEAN_NAME,
IntegrationEvaluationContextFactoryBean.class);
IntegrationEvaluationContextFactoryBean factory =
context.getBean("&" + IntegrationContextUtils.INTEGRATION_EVALUATION_CONTEXT_BEAN_NAME,
IntegrationEvaluationContextFactoryBean.class);
assertSame(evalContext.getTypeConverter(), TestUtils.getPropertyValue(factory, "typeConverter"));
}
@@ -67,7 +69,8 @@ public class ExpressionUtilsTests {
assertNotNull(evalContext.getBeanResolver());
TypeConverter typeConverter = evalContext.getTypeConverter();
assertNotNull(typeConverter);
assertSame(TestUtils.getPropertyValue(typeConverter, "defaultConversionService"), TestUtils.getPropertyValue(typeConverter, "conversionService"));
assertSame(DefaultConversionService.getSharedInstance(),
TestUtils.getPropertyValue(typeConverter, "conversionService"));
}
@Test
@@ -80,7 +83,7 @@ public class ExpressionUtilsTests {
assertNotNull(evalContext.getBeanResolver());
TypeConverter typeConverter = evalContext.getTypeConverter();
assertNotNull(typeConverter);
assertNotSame(TestUtils.getPropertyValue(typeConverter, "defaultConversionService"),
assertNotSame(DefaultConversionService.getSharedInstance(),
TestUtils.getPropertyValue(typeConverter, "conversionService"));
assertSame(context.getBean(IntegrationUtils.INTEGRATION_CONVERSION_SERVICE_BEAN_NAME),
TestUtils.getPropertyValue(typeConverter, "conversionService"));
@@ -92,7 +95,7 @@ public class ExpressionUtilsTests {
assertNull(evalContext.getBeanResolver());
TypeConverter typeConverter = evalContext.getTypeConverter();
assertNotNull(typeConverter);
assertSame(TestUtils.getPropertyValue(typeConverter, "defaultConversionService"),
assertSame(DefaultConversionService.getSharedInstance(),
TestUtils.getPropertyValue(typeConverter, "conversionService"));
}
}