diff options
author | Aurelien Poscia <aurelien.poscia@sonarsource.com> | 2023-05-22 09:23:48 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-05-22 20:02:56 +0000 |
commit | f0ea81e6d63cd87f899f5de13a69bee8969e6e33 (patch) | |
tree | e5b302827318dfaec8c8a4d87fb1e2271ded3fcb | |
parent | 50dba7534f62a4f22cb0d085a8abc2a9200c0d95 (diff) | |
download | sonarqube-f0ea81e6d63cd87f899f5de13a69bee8969e6e33.tar.gz sonarqube-f0ea81e6d63cd87f899f5de13a69bee8969e6e33.zip |
SONAR_19368 show full value of properties in /api/system/info
2 files changed, 6 insertions, 7 deletions
diff --git a/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/monitoring/SettingsSection.java b/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/monitoring/SettingsSection.java index 8ed2a63d597..537f99fb976 100644 --- a/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/monitoring/SettingsSection.java +++ b/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/monitoring/SettingsSection.java @@ -40,7 +40,6 @@ import org.sonar.process.systeminfo.protobuf.ProtobufSystemInfo.Section.Builder; import org.sonar.server.platform.NodeInformation; import static java.util.stream.Collectors.toUnmodifiableSet; -import static org.apache.commons.lang.StringUtils.abbreviate; import static org.apache.commons.lang.StringUtils.containsIgnoreCase; import static org.apache.commons.lang.StringUtils.endsWithIgnoreCase; import static org.sonar.process.ProcessProperties.Property.AUTH_JWT_SECRET; @@ -54,7 +53,6 @@ import static org.sonar.process.systeminfo.SystemInfoUtils.setAttribute; @ServerSide public class SettingsSection implements SystemInfoSection, Global { - private static final int MAX_VALUE_LENGTH = 500; private static final String PASSWORD_VALUE = "xxxxxxxx"; private static final Collection<String> IGNORED_SETTINGS_IN_CLUSTER = Stream.of( WEB_JAVA_OPTS, @@ -115,7 +113,7 @@ public class SettingsSection implements SystemInfoSection, Global { AUTH_JWT_SECRET.getKey().equals(key)) { return PASSWORD_VALUE; } - return abbreviate(value, MAX_VALUE_LENGTH); + return value; } private static String parseDefaultNewCodeDefinition(NewCodePeriodDto period) { diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/monitoring/SettingsSectionTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/monitoring/SettingsSectionTest.java index ff4a919f668..a402a307134 100644 --- a/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/monitoring/SettingsSectionTest.java +++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/monitoring/SettingsSectionTest.java @@ -120,12 +120,13 @@ public class SettingsSectionTest { } @Test - public void truncate_long_property_values() { - settings.setProperty("foo", repeat("abcde", 1_000)); + public void long_property_values_are_not_truncated() { + String value = repeat("abcde", 1_000); + settings.setProperty("foo", value); ProtobufSystemInfo.Section protobuf = underTest.toProtobuf(); - String value = attribute(protobuf, "foo").getStringValue(); - assertThat(value).hasSize(500).startsWith("abcde"); + String actualValue = attribute(protobuf, "foo").getStringValue(); + assertThat(actualValue).isEqualTo(value); } @Test |