Mapped Quarkus properties should not be persisted (#9808)

Closes #9807
This commit is contained in:
Pedro Igor 2022-01-27 07:12:31 -03:00 committed by GitHub
parent 7c162b42a6
commit d140abb8fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 1 deletions

View file

@ -328,7 +328,8 @@ class KeycloakProcessor {
}
}
} else if (mapper.isBuildTime()) {
value = Configuration.getConfigValue(mapper.getFrom());
name = mapper.getFrom();
value = Configuration.getConfigValue(name);
}
if (value != null && value.getValue() != null) {

View file

@ -238,6 +238,13 @@ public final class Picocli {
String runtimeValue = getRuntimeProperty(propertyName).orElse(null);
if (runtimeValue == null && isNotBlank(persistedValue)) {
PropertyMapper mapper = PropertyMappers.getMapper(propertyName);
if (mapper != null && persistedValue.equals(mapper.getDefaultValue())) {
// same as default
continue;
}
// probably because it was unset
return true;
}

View file

@ -76,4 +76,21 @@ public class StartAutoBuildDistTest {
cliResult.assertNoBuild();
cliResult.assertStarted();
}
@Test
@Launch({ "build", "--db=postgres" })
@Order(5)
void testBuildForReAugWhenAutoBuild(LaunchResult result) {
CLIResult cliResult = (CLIResult) result;
cliResult.assertBuild();
}
@Test
@Launch({ "start", "--auto-build", "--http-enabled=true", "--hostname-strict=false", "--cache=local" })
@Order(6)
void testReAugWhenNoOptionAfterBuild(LaunchResult result) {
CLIResult cliResult = (CLIResult) result;
cliResult.assertBuild();
cliResult.assertStarted();
}
}