Skip to content

Commit

Permalink
Add test for file://. (#551)
Browse files Browse the repository at this point in the history
  • Loading branch information
radcortez authored Apr 23, 2021
1 parent fdf761b commit 812b07f
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.Properties;
import java.util.stream.Stream;
Expand All @@ -38,7 +39,20 @@ void systemFile() {
.addDiscoveredSources()
.addDefaultInterceptors()
.withProfile("dev")
.withDefaultValue(SMALLRYE_LOCATIONS, String.join(",", "./src/test/resources/additional.properties"))
.withDefaultValue(SMALLRYE_LOCATIONS, "./src/test/resources/additional.properties")
.build();

assertEquals("1234", config.getRawValue("my.prop"));
assertNull(config.getRawValue("more.prop"));
assertEquals(1, countSources(config));

config = new SmallRyeConfigBuilder()
.addDiscoveredSources()
.addDefaultInterceptors()
.withProfile("dev")
.withDefaultValue(SMALLRYE_LOCATIONS,
Paths.get(System.getProperty("user.dir"), "src", "test", "resources", "additional.properties").toUri()
.toString())
.build();

assertEquals("1234", config.getRawValue("my.prop"));
Expand Down

0 comments on commit 812b07f

Please sign in to comment.