Skip to content

Commit 78cac67

Browse files
Fix exception message and test
1 parent fff29b3 commit 78cac67

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

server/src/main/java/org/elasticsearch/transport/RemoteClusterSettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ private UnsupportedInCPSValidator(String clusterAlias, String key) {
499499
@Override
500500
public void validate(T value, Map<Setting<?>, Object> settings, boolean isPresent) {
501501
if (isPresent && (Boolean) settings.get(cpsSetting)) {
502-
throw new IllegalArgumentException("setting [" + getKey() + "] is unavailable when stateless is enabled");
502+
throw new IllegalArgumentException("setting [" + getKey() + "] is unavailable when CPS is enabled");
503503
}
504504
super.validate(value, settings, isPresent);
505505
}

server/src/test/java/org/elasticsearch/transport/RemoteClusterSettingsTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public void testSkipUnavailableAlwaysTrueIfCPSEnabled() {
109109
.put(proxyAddressSetting.getKey(), "localhost:9400")
110110
.build();
111111

112-
// Ensure the validator still throws in non-stateless environment if a connection mode is not set.
112+
// Ensure the validator still throws in non-CPS environment if a connection mode is not set.
113113
var exception = expectThrows(
114114
IllegalArgumentException.class,
115115
() -> skipUnavailableSetting.get(Settings.builder().put(skipUnavailableSetting.getKey(), true).build())
@@ -119,7 +119,7 @@ public void testSkipUnavailableAlwaysTrueIfCPSEnabled() {
119119
equalTo("Cannot configure setting [" + skipUnavailableSetting.getKey() + "] if remote cluster is not enabled.")
120120
);
121121

122-
// Ensure we can still get the set value in non-stateless environment.
122+
// Ensure we can still get the set value in non-CPS environment.
123123
final var randomSkipUnavailableSettingValue = randomBoolean();
124124
assertThat(
125125
skipUnavailableSetting.get(
@@ -128,7 +128,7 @@ public void testSkipUnavailableAlwaysTrueIfCPSEnabled() {
128128
equalTo(randomSkipUnavailableSettingValue)
129129
);
130130

131-
// Check the validator rejects the skip_unavailable setting if present when stateless is enabled.
131+
// Check the validator rejects the skip_unavailable setting if present when CPS is enabled.
132132
exception = expectThrows(
133133
IllegalArgumentException.class,
134134
() -> skipUnavailableSetting.get(
@@ -141,7 +141,7 @@ public void testSkipUnavailableAlwaysTrueIfCPSEnabled() {
141141
);
142142
assertThat(
143143
exception.getMessage(),
144-
equalTo("setting [" + skipUnavailableSetting.getKey() + "] is unavailable when stateless is enabled")
144+
equalTo("setting [" + skipUnavailableSetting.getKey() + "] is unavailable when CPS is enabled")
145145
);
146146

147147
// Should not throw if the setting is not present, returning the expected default value of true.

0 commit comments

Comments
 (0)