Skip to content

Commit

Permalink
Switch versions
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed May 25, 2023
1 parent a8b952c commit 996649f
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ public class ExtensionsManagerTests extends OpenSearchTestCase {
" hostAddress: '127.0.0.1'",
" port: '9301'",
" version: '3.14.16'",
" opensearchVersion: '" + Version.CURRENT.toString() + "'",
" minimumCompatibleVersion: '" + Version.CURRENT.toString() + "'",
" opensearchVersion: '1.0.0'",
" minimumCompatibleVersion: '1.0.0'",
" dependencies:",
" - uniqueId: 'uniqueid0'",
" version: '2.0.0'"
" version: '1.0.0'"
);

private DiscoveryExtensionNode extensionNode;
Expand Down Expand Up @@ -187,7 +187,7 @@ public List<Setting<?>> getExtensionSettings() {
"uniqueid1",
new TransportAddress(InetAddress.getByName("127.0.0.0"), 9300),
new HashMap<String, String>(),
Version.fromString("3.0.0"),
Version.CURRENT,
Version.CURRENT,
Collections.emptyList()
);
Expand All @@ -211,7 +211,7 @@ public void testDiscover() throws Exception {
List<DiscoveryExtensionNode> expectedExtensions = new ArrayList<DiscoveryExtensionNode>();

String expectedUniqueId = "uniqueid0";
Version expectedVersion = Version.fromString("2.0.0");
Version expectedVersion = Version.fromString("1.0.0");
ExtensionDependency expectedDependency = new ExtensionDependency(expectedUniqueId, expectedVersion);

expectedExtensions.add(
Expand All @@ -232,8 +232,8 @@ public void testDiscover() throws Exception {
"uniqueid2",
new TransportAddress(InetAddress.getByName("127.0.0.1"), 9301),
new HashMap<String, String>(),
Version.CURRENT,
Version.CURRENT,
Version.fromString("1.0.0"),
Version.fromString("1.0.0"),
List.of(expectedDependency)
)
);
Expand Down Expand Up @@ -293,7 +293,7 @@ public void testMissingRequiredFieldsInExtensionDiscovery() throws Exception {
Path emptyExtensionDir = createTempDir();
ExtensionsManager extensionsManager;
List<String> requiredFieldMissingYmlLines = extensionsYmlLines.stream()
.map(s -> s.replace(" minimumCompatibleVersion: '2.0.0'", ""))
.map(s -> s.replace(" minimumCompatibleVersion: '1.0.0'", ""))
.collect(Collectors.toList());
Files.write(emptyExtensionDir.resolve("extensions.yml"), requiredFieldMissingYmlLines, StandardCharsets.UTF_8);

Expand Down Expand Up @@ -321,8 +321,8 @@ public void testMissingRequiredFieldsInExtensionDiscovery() throws Exception {
"uniqueid1",
new TransportAddress(InetAddress.getByName("127.0.0.0"), 9300),
new HashMap<String, String>(),
Version.fromString("3.0.0"),
Version.fromString("3.0.0"),
Version.CURRENT,
Version.CURRENT,
Collections.emptyList()
)
);
Expand Down Expand Up @@ -371,7 +371,7 @@ public void testDiscoveryExtension() throws Exception {

public void testExtensionDependency() throws Exception {
String expectedUniqueId = "Test uniqueId";
Version expectedVersion = Version.fromString("3.0.0");
Version expectedVersion = Version.CURRENT;

ExtensionDependency dependency = new ExtensionDependency(expectedUniqueId, expectedVersion);

Expand Down Expand Up @@ -851,7 +851,7 @@ public void testIncompatibleExtensionRegistration() throws IOException, IllegalA
"Could not load extension with uniqueId",
"org.opensearch.extensions.ExtensionsManager",
Level.ERROR,
"Could not load extension with uniqueId uniqueid1 due to OpenSearchException[Extension minimumCompatibleVersion: 3.99.0 is greater than current"
"Could not load extension with uniqueId uniqueid1 due to OpenSearchException[Extension minimumCompatibleVersion: 3.0.0 is greater than current"
)
);

Expand All @@ -862,8 +862,8 @@ public void testIncompatibleExtensionRegistration() throws IOException, IllegalA
" hostAddress: '127.0.0.0'",
" port: '9300'",
" version: '0.0.7'",
" opensearchVersion: '3.0.0'",
" minimumCompatibleVersion: '3.99.0'"
" opensearchVersion: '" + Version.CURRENT.toString() + "'",
" minimumCompatibleVersion: '3.0.0'"
);

Files.write(extensionDir.resolve("extensions.yml"), incompatibleExtension, StandardCharsets.UTF_8);
Expand All @@ -885,8 +885,8 @@ public void testAdditionalExtensionSettingsForExtensionWithCustomSettingSet() th
"uniqueid1",
new TransportAddress(InetAddress.getByName("127.0.0.1"), 9300),
new HashMap<String, String>(),
Version.fromString("3.0.0"),
Version.fromString("3.0.0"),
Version.CURRENT,
Version.CURRENT,
List.of()
);
DiscoveryExtensionNode initializedExtension = extensionsManager.getExtensionIdMap().get(extension.getId());
Expand Down

0 comments on commit 996649f

Please sign in to comment.