Skip to content

Commit

Permalink
Fix 7 order-dependent tests by adding a precondition
Browse files Browse the repository at this point in the history
  • Loading branch information
xinbolu2 committed Nov 19, 2023
1 parent 6843cb0 commit f4f90b9
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ public class NacosConfigDataLocationResolverTest {
@BeforeEach
void setup() {
this.environment = new MockEnvironment();
environment.setProperty("spring.cloud.nacos.username", "root");
environment.setProperty("spring.cloud.nacos.password", "root");
environment.setProperty("spring.cloud.nacos.config.password", "not_root");
environment.setProperty("spring.cloud.nacos.server-addr", "127.0.0.1:8888");
environment.setProperty("spring.cloud.nacos.config.server-addr",
"127.0.0.1:9999");
this.environmentBinder = Binder.get(this.environment);
this.resolver = new NacosConfigDataLocationResolver(new DeferredLogs());
when(bootstrapContext.isRegistered(eq(ConfigService.class))).thenReturn(true);
Expand Down Expand Up @@ -166,7 +172,10 @@ void testUrisInLocationShouldOverridesProperty() {
void testSetCommonPropertiesIsOK() {
environment.setProperty("spring.cloud.nacos.username", "root");
environment.setProperty("spring.cloud.nacos.password", "root");
environment.setProperty("spring.cloud.nacos.config.password", "root");
environment.setProperty("spring.cloud.nacos.server-addr", "127.0.0.1:8888");
environment.setProperty("spring.cloud.nacos.config.server-addr",
"127.0.0.1:8888");
String locationUri = "nacos:test.yml";
List<NacosConfigDataResource> resources = testUri(locationUri);

Expand Down

0 comments on commit f4f90b9

Please sign in to comment.