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:
parent
3b3c60fbc7
commit
b50cd9266f
@ -19,8 +19,8 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<sentinel.version>1.4.2</sentinel.version>
|
<sentinel.version>1.4.2</sentinel.version>
|
||||||
<oss.version>3.1.0</oss.version>
|
<oss.version>3.1.0</oss.version>
|
||||||
<fescar.version>0.1.3</fescar.version>
|
<fescar.version>0.2.3</fescar.version>
|
||||||
<nacos.client.version>0.8.2</nacos.client.version>
|
<nacos.client.version>0.9.1</nacos.client.version>
|
||||||
<nacos.config.version>0.8.0</nacos.config.version>
|
<nacos.config.version>0.8.0</nacos.config.version>
|
||||||
<acm.version>1.0.8</acm.version>
|
<acm.version>1.0.8</acm.version>
|
||||||
<ans.version>1.0.1</ans.version>
|
<ans.version>1.0.1</ans.version>
|
||||||
|
@ -5,5 +5,5 @@ mysql.server.ip=127.0.0.1
|
|||||||
mysql.server.port=3306
|
mysql.server.port=3306
|
||||||
mysql.db.name=demo
|
mysql.db.name=demo
|
||||||
|
|
||||||
mysql.user.name=xxxxx
|
mysql.user.name=root
|
||||||
mysql.user.password=xxxxx
|
mysql.user.password=123456
|
@ -16,15 +16,12 @@
|
|||||||
|
|
||||||
package org.springframework.cloud.alibaba.nacos;
|
package org.springframework.cloud.alibaba.nacos;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.NONE;
|
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.NONE;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationHandler;
|
import java.lang.reflect.InvocationHandler;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import com.alibaba.nacos.client.config.NacosConfigService;
|
import com.alibaba.nacos.client.config.NacosConfigService;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
@ -42,7 +39,6 @@ import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
|||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.cloud.alibaba.nacos.client.NacosPropertySourceLocator;
|
import org.springframework.cloud.alibaba.nacos.client.NacosPropertySourceLocator;
|
||||||
import org.springframework.cloud.alibaba.nacos.endpoint.NacosConfigEndpointAutoConfiguration;
|
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.context.annotation.Configuration;
|
||||||
import org.springframework.core.env.Environment;
|
import org.springframework.core.env.Environment;
|
||||||
import org.springframework.test.context.junit4.SpringRunner;
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
@ -164,12 +164,10 @@ public class NacosConfigurationTests {
|
|||||||
checkoutNacosConfigTimeout();
|
checkoutNacosConfigTimeout();
|
||||||
checkoutNacosConfigEncode();
|
checkoutNacosConfigEncode();
|
||||||
checkoutNacosConfigProfiles();
|
checkoutNacosConfigProfiles();
|
||||||
checkoutNacosConfigExtConfig();
|
|
||||||
|
|
||||||
checkoutEndpoint();
|
checkoutEndpoint();
|
||||||
|
checkoutDataLoad();
|
||||||
|
|
||||||
Assert.assertEquals(environment.getProperty("user.name"), "dev");
|
|
||||||
Assert.assertEquals(environment.getProperty("user.age"), "12");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkoutNacosConfigServerAddr() {
|
private void checkoutNacosConfigServerAddr() {
|
||||||
@ -235,15 +233,10 @@ public class NacosConfigurationTests {
|
|||||||
properties.getEncode());
|
properties.getEncode());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkoutNacosConfigExtConfig() {
|
private void checkoutDataLoad() {
|
||||||
assertEquals("NacosConfigProperties' ext config is wrong",
|
|
||||||
"ext-config-common01.properties",
|
Assert.assertEquals(environment.getProperty("user.name"), "dev");
|
||||||
properties.getExtConfig().get(0).getDataId());
|
Assert.assertEquals(environment.getProperty("user.age"), "12");
|
||||||
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 checkoutNacosConfigProfiles() {
|
private void checkoutNacosConfigProfiles() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user