Merge pull request #32740 from izeye

* gh-32740:
  Fix configLocationsWithConfigurationFileSystemProperty

Closes gh-32740
This commit is contained in:
Andy Wilkinson 2022-11-08 13:18:08 +00:00
commit 3c51845864

View File

@ -314,8 +314,8 @@ class Log4J2LoggingSystemTests extends AbstractLoggingSystemTests {
void configLocationsWithConfigurationFileSystemProperty() {
System.setProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY, "custom-log4j2.properties");
try {
assertThat(this.loggingSystem.getStandardConfigLocations()).contains("log4j2-test.properties",
"log4j2-test.xml", "log4j2.properties", "log4j2.xml");
assertThat(this.loggingSystem.getStandardConfigLocations()).containsExactly("log4j2-test.properties",
"log4j2-test.xml", "log4j2.properties", "log4j2.xml", "custom-log4j2.properties");
}
finally {
System.clearProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY);