mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
add unit test for nacos config
This commit is contained in:
parent
431b246507
commit
6ca806c313
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user