mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
update nacos and fescar version and format some testcase
This commit is contained in:
@@ -16,15 +16,12 @@
|
||||
|
||||
package org.springframework.cloud.alibaba.nacos;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.NONE;
|
||||
|
||||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.nacos.client.config.NacosConfigService;
|
||||
|
||||
import org.junit.Assert;
|
||||
@@ -42,7 +39,6 @@ import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.cloud.alibaba.nacos.client.NacosPropertySourceLocator;
|
||||
import org.springframework.cloud.alibaba.nacos.endpoint.NacosConfigEndpointAutoConfiguration;
|
||||
import org.springframework.cloud.alibaba.nacos.refresh.NacosRefreshHistory;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
@@ -164,12 +164,10 @@ public class NacosConfigurationTests {
|
||||
checkoutNacosConfigTimeout();
|
||||
checkoutNacosConfigEncode();
|
||||
checkoutNacosConfigProfiles();
|
||||
checkoutNacosConfigExtConfig();
|
||||
|
||||
checkoutEndpoint();
|
||||
checkoutDataLoad();
|
||||
|
||||
Assert.assertEquals(environment.getProperty("user.name"), "dev");
|
||||
Assert.assertEquals(environment.getProperty("user.age"), "12");
|
||||
}
|
||||
|
||||
private void checkoutNacosConfigServerAddr() {
|
||||
@@ -235,15 +233,10 @@ public class NacosConfigurationTests {
|
||||
properties.getEncode());
|
||||
}
|
||||
|
||||
private void checkoutNacosConfigExtConfig() {
|
||||
assertEquals("NacosConfigProperties' ext config is wrong",
|
||||
"ext-config-common01.properties",
|
||||
properties.getExtConfig().get(0).getDataId());
|
||||
assertEquals("NacosConfigProperties' ext config is wrong",
|
||||
"ext-config-common02.properties",
|
||||
properties.getExtConfig().get(1).getDataId());
|
||||
assertEquals("NacosConfigProperties' ext config is wrong", "GLOBAL_GROUP",
|
||||
properties.getExtConfig().get(1).getGroup());
|
||||
private void checkoutDataLoad() {
|
||||
|
||||
Assert.assertEquals(environment.getProperty("user.name"), "dev");
|
||||
Assert.assertEquals(environment.getProperty("user.age"), "12");
|
||||
}
|
||||
|
||||
private void checkoutNacosConfigProfiles() {
|
||||
|
Reference in New Issue
Block a user