Ensure UPPER_CASE overrides work in PropertiesLauncher
This commit is contained in:
@@ -72,6 +72,15 @@ public class PropertiesLauncherTests {
|
||||
assertEquals("[etc/]", ReflectionTestUtils.getField(launcher, "paths").toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUserSpecifiedConfigPathWins() throws Exception {
|
||||
|
||||
System.setProperty("loader.config.name", "foo");
|
||||
System.setProperty("loader.config.location", "classpath:bar.properties");
|
||||
PropertiesLauncher launcher = new PropertiesLauncher();
|
||||
assertEquals("my.BarApplication", launcher.getMainClass());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSystemPropertySpecifiedMain() throws Exception {
|
||||
System.setProperty("loader.main", "foo.Bar");
|
||||
|
||||
@@ -19,7 +19,6 @@ package org.springframework.boot.loader.util;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.springframework.boot.loader.util.SystemPropertyUtils;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -53,4 +52,9 @@ public class SystemPropertyUtilsTests {
|
||||
assertEquals("foo", SystemPropertyUtils.resolvePlaceholders("${bar:${spam:foo}}"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEnvVar() {
|
||||
assertEquals(System.getenv("LANG"), SystemPropertyUtils.getProperty("lang"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
loader.main: my.BarApplication
|
||||
Reference in New Issue
Block a user