mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-28 07:26:56 +00:00
#1555 - Support .yaml extension (in addition to the existing .yml extension) for application.yaml and application-test.yaml
This commit is contained in:
1 parent
ecf5b56652
commit
b4154031cc
3 files changed
+6
-1
No files matched your search
@@ -101,7 +101,7 @@ class Loader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void loadWithExtensionCheck(String fileName) {
|
void loadWithExtensionCheck(String fileName) {
|
||||||
if (fileName.endsWith("yml")) {
|
if (fileName.endsWith("yaml") || fileName.endsWith("yml")) {
|
||||||
loadYaml(fileName, Source.FILE);
|
loadYaml(fileName, Source.FILE);
|
||||||
} else if (fileName.endsWith("properties")) {
|
} else if (fileName.endsWith("properties")) {
|
||||||
loadProperties(fileName, Source.FILE);
|
loadProperties(fileName, Source.FILE);
|
||||||
|
|||||||
@@ -38,8 +38,10 @@ public class LoaderTest {
|
|||||||
Loader loader = new Loader();
|
Loader loader = new Loader();
|
||||||
loader.loadWithExtensionCheck("test-dummy.properties");
|
loader.loadWithExtensionCheck("test-dummy.properties");
|
||||||
loader.loadWithExtensionCheck("test-dummy.yml");
|
loader.loadWithExtensionCheck("test-dummy.yml");
|
||||||
|
loader.loadWithExtensionCheck("test-dummy2.yaml");
|
||||||
|
|
||||||
Properties properties = loader.eval();
|
Properties properties = loader.eval();
|
||||||
|
assertThat(properties.getProperty("dummy.yaml.bar")).isEqualTo("baz");
|
||||||
assertThat(properties.getProperty("dummy.yml.foo")).isEqualTo("bar");
|
assertThat(properties.getProperty("dummy.yml.foo")).isEqualTo("bar");
|
||||||
assertThat(properties.getProperty("dummy.properties.foo")).isEqualTo("bar");
|
assertThat(properties.getProperty("dummy.properties.foo")).isEqualTo("bar");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
dummy:
|
||||||
|
yaml:
|
||||||
|
bar: baz
|
||||||
Reference in new issue
Block a user