diff --git a/spring-cloud-alibaba-nacos-config/src/test/java/org/springframework/cloud/alibaba/nacos/NacosConfigAutoConfigurationTests.java b/spring-cloud-alibaba-nacos-config/src/test/java/org/springframework/cloud/alibaba/nacos/NacosConfigAutoConfigurationTests.java index 23fc2bd42..32d63fd61 100644 --- a/spring-cloud-alibaba-nacos-config/src/test/java/org/springframework/cloud/alibaba/nacos/NacosConfigAutoConfigurationTests.java +++ b/spring-cloud-alibaba-nacos-config/src/test/java/org/springframework/cloud/alibaba/nacos/NacosConfigAutoConfigurationTests.java @@ -16,14 +16,14 @@ package org.springframework.cloud.alibaba.nacos; +import static org.assertj.core.api.Assertions.assertThat; + import org.junit.Test; import org.springframework.cloud.alibaba.nacos.client.NacosPropertySourceLocator; import org.springframework.cloud.alibaba.nacos.refresh.NacosRefreshProperties; import org.springframework.core.env.CompositePropertySource; import org.springframework.core.env.PropertySource; -import static org.assertj.core.api.Assertions.assertThat; - /** * @author xiaojing * @author pbting @@ -61,10 +61,7 @@ public class NacosConfigAutoConfigurationTests extends NacosPowerMockitBaseTests .getBean(NacosPropertySourceLocator.class); PropertySource propertySource = nacosPropertySourceLocator .locate(this.context.getEnvironment()); - assertThat(propertySource instanceof CompositePropertySource).isEqualTo(true); - CompositePropertySource compositePropertySource = (CompositePropertySource) propertySource; - assertThat(compositePropertySource.containsProperty("user.name")).isEqualTo(true); } @Test