mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-10 15:32:05 -03:30
Make sure configuration is loaded with mapped/transformed properties at first (#30101)
* edited Picocli and added a corresponding test for Windows Closes: #29329 Signed-off-by: Peter Zaoral <pzaoral@redhat.com> Co-authored-by: Vaclav Muzikar <vmuzikar@redhat.com>
This commit is contained in:
parent
859a926597
commit
cab3e51c96
@ -280,6 +280,7 @@ public final class Picocli {
|
||||
}
|
||||
|
||||
try {
|
||||
getConfig(); // ensure the config is initialized before the interceptor is disabled
|
||||
PropertyMappingInterceptor.disable(); // we don't want the mapped / transformed properties, we want what the user effectively supplied
|
||||
List<String> ignoredBuildTime = new ArrayList<>();
|
||||
List<String> ignoredRunTime = new ArrayList<>();
|
||||
|
||||
@ -22,9 +22,16 @@ import io.quarkus.test.junit.main.LaunchResult;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
import org.junit.jupiter.api.condition.DisabledOnOs;
|
||||
import org.junit.jupiter.api.condition.OS;
|
||||
import org.keycloak.it.junit5.extension.CLIResult;
|
||||
import org.keycloak.it.junit5.extension.DistributionTest;
|
||||
import org.keycloak.it.junit5.extension.RawDistOnly;
|
||||
import org.keycloak.it.utils.KeycloakDistribution;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
@DistributionTest
|
||||
@RawDistOnly(reason = "Containers are immutable")
|
||||
@ -68,4 +75,15 @@ public class StartDevCommandDistTest {
|
||||
cliResult.assertStartedDevMode();
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisabledOnOs(value = { OS.LINUX, OS.MAC }, disabledReason = "A drive letter in URI can cause a problem.")
|
||||
void testConfigKeystoreAbsolutePath(KeycloakDistribution dist) {
|
||||
CLIResult cliResult = dist.run("start-dev", "--config-keystore=" + Paths.get("src/test/resources/keystore").toAbsolutePath().normalize(),
|
||||
"--config-keystore-password=secret");
|
||||
assertTrue(cliResult.getOutput().contains("DEBUG [org.hibernate"));
|
||||
assertTrue(cliResult.getOutput().contains("DEBUG [org.keycloak"));
|
||||
assertTrue(cliResult.getOutput().contains("Listening on:"));
|
||||
cliResult.assertStartedDevMode();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user