From 6c47593aef04a710fe722dcfd5c83091932afe49 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Tue, 19 Oct 2021 09:46:35 -0400 Subject: [PATCH] Fix ExpressionUtilsTests according SF changes Related to: https://github.com/spring-projects/spring-framework/issues/27446 --- .../expression/ExpressionUtilsTests.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/expression/ExpressionUtilsTests.java b/spring-integration-core/src/test/java/org/springframework/integration/expression/ExpressionUtilsTests.java index 267c26e093..2cf1d4efce 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/expression/ExpressionUtilsTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/expression/ExpressionUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2019 the original author or authors. + * Copyright 2013-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,9 @@ package org.springframework.integration.expression; import static org.assertj.core.api.Assertions.assertThat; -import org.junit.Test; +import java.util.function.Supplier; + +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.context.support.ConversionServiceFactoryBean; @@ -33,6 +35,7 @@ import org.springframework.integration.test.util.TestUtils; /** * @author Gary Russell + * @author Artem Bilan * * @since 3.0 */ @@ -66,7 +69,7 @@ public class ExpressionUtilsTests { assertThat(evalContext.getBeanResolver()).isNotNull(); TypeConverter typeConverter = evalContext.getTypeConverter(); assertThat(typeConverter).isNotNull(); - assertThat(TestUtils.getPropertyValue(typeConverter, "conversionService")) + assertThat(TestUtils.getPropertyValue(typeConverter, "conversionService", Supplier.class).get()) .isSameAs(DefaultConversionService.getSharedInstance()); } @@ -80,9 +83,9 @@ public class ExpressionUtilsTests { assertThat(evalContext.getBeanResolver()).isNotNull(); TypeConverter typeConverter = evalContext.getTypeConverter(); assertThat(typeConverter).isNotNull(); - assertThat(TestUtils.getPropertyValue(typeConverter, "conversionService")) + assertThat(TestUtils.getPropertyValue(typeConverter, "conversionService", Supplier.class).get()) .isNotSameAs(DefaultConversionService.getSharedInstance()); - assertThat(TestUtils.getPropertyValue(typeConverter, "conversionService")) + assertThat(TestUtils.getPropertyValue(typeConverter, "conversionService", Supplier.class).get()) .isSameAs(context.getBean(IntegrationUtils.INTEGRATION_CONVERSION_SERVICE_BEAN_NAME)); } @@ -92,7 +95,8 @@ public class ExpressionUtilsTests { assertThat(evalContext.getBeanResolver()).isNull(); TypeConverter typeConverter = evalContext.getTypeConverter(); assertThat(typeConverter).isNotNull(); - assertThat(TestUtils.getPropertyValue(typeConverter, "conversionService")) + assertThat(TestUtils.getPropertyValue(typeConverter, "conversionService", Supplier.class).get()) .isSameAs(DefaultConversionService.getSharedInstance()); } + }