mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
fix tests
This commit is contained in:
parent
a2b158d67d
commit
7b7cb91258
@ -45,9 +45,10 @@ public class NacosConfigAutoConfigurationTests {
|
||||
this.context = new SpringApplicationBuilder(
|
||||
NacosConfigBootstrapConfiguration.class,
|
||||
NacosConfigAutoConfiguration.class, TestConfiguration.class).web(false)
|
||||
.run("--spring.cloud.config.enabled=true",
|
||||
.run("--spring.application.name=myapp",
|
||||
"--spring.cloud.config.enabled=true",
|
||||
"--spring.cloud.nacos.config.server-addr=127.0.0.1:8080",
|
||||
"--spring.cloud.nacos.config.prefix=myapp");
|
||||
"--spring.cloud.nacos.config.prefix=test");
|
||||
}
|
||||
|
||||
@After
|
||||
@ -62,7 +63,8 @@ public class NacosConfigAutoConfigurationTests {
|
||||
NacosConfigProperties nacosConfigProperties = this.context.getParent()
|
||||
.getBean(NacosConfigProperties.class);
|
||||
assertThat(nacosConfigProperties.getFileExtension()).isEqualTo("properties");
|
||||
assertThat(nacosConfigProperties.getPrefix()).isEqualTo("myapp");
|
||||
assertThat(nacosConfigProperties.getPrefix()).isEqualTo("test");
|
||||
assertThat(nacosConfigProperties.getName()).isEqualTo("myapp");
|
||||
|
||||
}
|
||||
|
||||
|
@ -42,6 +42,7 @@ public class NacosConfigBootstrapConfigurationTests {
|
||||
public void setUp() throws Exception {
|
||||
this.context = new SpringApplicationBuilder(
|
||||
NacosConfigBootstrapConfiguration.class).web(false).run(
|
||||
"--spring.application.name=true",
|
||||
"--spring.cloud.config.enabled=true",
|
||||
"--spring.cloud.nacos.config.server-addr=127.0.0.1:8080",
|
||||
"--spring.cloud.nacos.config.prefix=myapp");
|
||||
|
Loading…
x
Reference in New Issue
Block a user