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;
@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,
AUTH_JWT_SECRET.getKey().equals(key)) {
return PASSWORD_VALUE;
}
- return abbreviate(value, MAX_VALUE_LENGTH);
+ return value;
}
private static String parseDefaultNewCodeDefinition(NewCodePeriodDto period) {
}
@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