Skip to content

Commit

Permalink
Sorts component conf files in the correct order
Browse files Browse the repository at this point in the history
These need to be reversed as `withFallback` is used for each config. This means that only properties that are missing in the first one are taken from the second one and so on.

Fixes: SIRI-891
  • Loading branch information
sabieber committed Oct 16, 2023
1 parent a37a119 commit 619cb73
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/sirius/kernel/Sirius.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.time.Duration;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -346,7 +347,7 @@ private static void setupApplicationAndSystemConfig() {
// Load test configurations (will override component configs)
classpath.find(Pattern.compile("component-test-([^.]*?)\\.conf"))
.map(Matcher::group)
.sorted()
.sorted(Comparator.reverseOrder())
.forEach(configPath -> {
try {
LOG.INFO("Loading test config: %s", configPath);
Expand All @@ -361,7 +362,7 @@ private static void setupApplicationAndSystemConfig() {
classpath.find(Pattern.compile("component-([^\\-]*?)([^.]*?)\\.conf"))
.map(Matcher::group)
.filter(configPath -> !"test".equals(configPath))
.sorted()
.sorted(Comparator.reverseOrder())
.forEach(configPath -> {
try {
LOG.INFO("Loading config: %s", configPath);
Expand Down

0 comments on commit 619cb73

Please sign in to comment.