コード例 #1
0
 @Before
 public void init() throws Exception {
   String uri = ConfigServerTestUtils.prepareLocalRepo();
   this.repository.setUri(uri);
   if (this.basedir.exists()) {
     FileUtils.delete(this.basedir, FileUtils.RECURSIVE | FileUtils.RETRY);
   }
 }
コード例 #2
0
 @Test
 public void nestedPattern() throws IOException {
   String uri = ConfigServerTestUtils.prepareLocalRepo("another-config-repo");
   this.repository.setUri(uri);
   this.repository.setSearchPaths(new String[] {"sub*"});
   this.repository.findOne("bar", "staging", "master");
   Environment environment = this.repository.findOne("bar", "staging", "master");
   assertEquals(2, environment.getPropertySources().size());
   assertEquals(
       this.repository.getUri() + "/sub/application.yml",
       environment.getPropertySources().get(0).getName());
 }