mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-27 10:28:28 +00:00
Fix multiple failing server tests. (#453)
This commit fixes some renaming issues which as a result fixes multiple failing unit tests in the server module. Signed-off-by: Rabi Panda <adnapibar@gmail.com>
This commit is contained in:
parent
51b4010f56
commit
c79bab46a0
@ -118,7 +118,7 @@ public class MetadataIndexUpgradeService {
|
||||
throw new IllegalStateException("The index [" + indexMetadata.getIndex() + "] was created with version ["
|
||||
+ indexMetadata.getCreationVersion() + "] but the minimum compatible version is ["
|
||||
|
||||
+ minimumIndexCompatibilityVersion + "]. It should be re-indexed in Elasticsearch " + minimumIndexCompatibilityVersion.major
|
||||
+ minimumIndexCompatibilityVersion + "]. It should be re-indexed in OpenSearch " + minimumIndexCompatibilityVersion.major
|
||||
+ ".x before upgrading to " + Version.CURRENT + ".");
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public class BalanceUnbalancedClusterTests extends CatAllocationTestCase {
|
||||
@Override
|
||||
protected Path getCatPath() throws IOException {
|
||||
Path tmp = createTempDir();
|
||||
try (InputStream stream = Files.newInputStream(getDataPath("/org/opensearch/routing/issue_9023.zip"))) {
|
||||
try (InputStream stream = Files.newInputStream(getDataPath("/org/opensearch/cluster/routing/issue_9023.zip"))) {
|
||||
TestUtil.unzip(stream, tmp);
|
||||
}
|
||||
return tmp.resolve("issue_9023");
|
||||
|
@ -1096,7 +1096,7 @@ public class ScopedSettingsTests extends OpenSearchTestCase {
|
||||
final Settings settings = Settings.builder().put("index.private", "private").build();
|
||||
indexScopedSettings.validate(settings, false, /* validateInternalOrPrivateIndex */ true);
|
||||
});
|
||||
final String message = "can not update private setting [index.private]; this setting is managed by Elasticsearch";
|
||||
final String message = "can not update private setting [index.private]; this setting is managed by OpenSearch";
|
||||
assertThat(e, hasToString(containsString(message)));
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
package org.opensearch.common.settings;
|
||||
|
||||
import org.opensearch.common.settings.MockSecureSettings;
|
||||
import org.opensearch.OpenSearchParseException;
|
||||
import org.opensearch.Version;
|
||||
import org.opensearch.common.Strings;
|
||||
@ -494,7 +493,7 @@ public class SettingsTests extends OpenSearchTestCase {
|
||||
Setting<SecureString> setting = SecureSetting.secureString("something.secure", null);
|
||||
Settings settings = Settings.builder().put("something.secure", "notreallysecure").build();
|
||||
IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> setting.get(settings));
|
||||
assertTrue(e.getMessage().contains("must be stored inside the Elasticsearch keystore"));
|
||||
assertTrue(e.getMessage().contains("must be stored inside the OpenSearch keystore"));
|
||||
}
|
||||
|
||||
public void testSecureSettingIllegalName() {
|
||||
@ -539,7 +538,7 @@ public class SettingsTests extends OpenSearchTestCase {
|
||||
}
|
||||
|
||||
public void testSimpleJsonSettings() throws Exception {
|
||||
final String json = "/org/elasticsearch/common/settings/loader/test-settings.json";
|
||||
final String json = "/org/opensearch/common/settings/loader/test-settings.json";
|
||||
final Settings settings = Settings.builder()
|
||||
.loadFromStream(json, getClass().getResourceAsStream(json), false)
|
||||
.build();
|
||||
@ -586,7 +585,7 @@ public class SettingsTests extends OpenSearchTestCase {
|
||||
}
|
||||
|
||||
public void testSimpleYamlSettings() throws Exception {
|
||||
final String yaml = "/org/elasticsearch/common/settings/loader/test-settings.yml";
|
||||
final String yaml = "/org/opensearch/common/settings/loader/test-settings.yml";
|
||||
final Settings settings = Settings.builder()
|
||||
.loadFromStream(yaml, getClass().getResourceAsStream(yaml), false)
|
||||
.build();
|
||||
@ -613,7 +612,7 @@ public class SettingsTests extends OpenSearchTestCase {
|
||||
}
|
||||
|
||||
public void testIndentation() throws Exception {
|
||||
String yaml = "/org/elasticsearch/common/settings/loader/indentation-settings.yml";
|
||||
String yaml = "/org/opensearch/common/settings/loader/indentation-settings.yml";
|
||||
OpenSearchParseException e = expectThrows(OpenSearchParseException.class, () -> {
|
||||
Settings.builder().loadFromStream(yaml, getClass().getResourceAsStream(yaml), false);
|
||||
});
|
||||
@ -621,7 +620,7 @@ public class SettingsTests extends OpenSearchTestCase {
|
||||
}
|
||||
|
||||
public void testIndentationWithExplicitDocumentStart() throws Exception {
|
||||
String yaml = "/org/elasticsearch/common/settings/loader/indentation-with-explicit-document-start-settings.yml";
|
||||
String yaml = "/org/opensearch/common/settings/loader/indentation-with-explicit-document-start-settings.yml";
|
||||
OpenSearchParseException e = expectThrows(OpenSearchParseException.class, () -> {
|
||||
Settings.builder().loadFromStream(yaml, getClass().getResourceAsStream(yaml), false);
|
||||
});
|
||||
|
@ -831,7 +831,7 @@ public abstract class BaseXContentTestCase extends OpenSearchTestCase {
|
||||
Map<String, Object> objects = new HashMap<>();
|
||||
objects.put("{'obj':50.63}", DistanceUnit.METERS.fromMeters(50.63));
|
||||
objects.put("{'obj':'MINUTES'}", TimeUnit.MINUTES);
|
||||
objects.put("{'obj':'class BaseXContentTestCase'}", BaseXContentTestCase.class);
|
||||
objects.put("{'obj':'class org.opensearch.common.xcontent.BaseXContentTestCase'}", BaseXContentTestCase.class);
|
||||
|
||||
for (Map.Entry<String, ?> o : objects.entrySet()) {
|
||||
final String expected = o.getKey();
|
||||
|
@ -457,7 +457,7 @@ public abstract class OpenSearchTestCase extends LuceneTestCase {
|
||||
Stream.concat(
|
||||
Arrays
|
||||
.stream(settings)
|
||||
.map(k -> "[" + k + "] setting was deprecated and will be removed in a future release! " +
|
||||
.map(k -> "[" + k + "] setting was deprecated in OpenSearch and will be removed in a future release! " +
|
||||
"See the breaking changes documentation for the next major version."),
|
||||
Arrays.stream(warnings))
|
||||
.toArray(String[]::new));
|
||||
|
Loading…
x
Reference in New Issue
Block a user