Skip to content

Commit

Permalink
Spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-ivanov-es committed Dec 12, 2024
1 parent 2708b04 commit f458502
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
import org.elasticsearch.core.IOUtils;
import org.elasticsearch.core.PathUtils;
import org.elasticsearch.core.SuppressForbidden;
import org.elasticsearch.core.UpdateForV10;
import org.elasticsearch.core.UpdateForV9;
import org.elasticsearch.gateway.MetadataStateFormat;
import org.elasticsearch.gateway.PersistedClusterStateService;
import org.elasticsearch.index.Index;
Expand Down Expand Up @@ -584,7 +582,8 @@ public void testIndexCompatibilityChecks() throws IOException {
containsString(
"Revert this node to version ["
+ (previousNodeVersion.major == Version.CURRENT.major
? Version.CURRENT.minimumCompatibilityVersion() : previousNodeVersion)
? Version.CURRENT.minimumCompatibilityVersion()
: previousNodeVersion)
+ "]"
)
)
Expand Down Expand Up @@ -639,18 +638,30 @@ public void testSymlinkDataDirectory() throws Exception {
}

public void testGetBestDowngradeVersion() {
assertThat(NodeEnvironment.getBestDowngradeVersion(BuildVersion.fromString("8.18.0")),
Matchers.equalTo(BuildVersion.fromString("8.18.0")));
assertThat(NodeEnvironment.getBestDowngradeVersion(BuildVersion.fromString("8.18.5")),
Matchers.equalTo(BuildVersion.fromString("8.18.5")));
assertThat(NodeEnvironment.getBestDowngradeVersion(BuildVersion.fromString("8.18.12")),
Matchers.equalTo(BuildVersion.fromString("8.18.12")));
assertThat(NodeEnvironment.getBestDowngradeVersion(BuildVersion.fromString("8.19.0")),
Matchers.equalTo(BuildVersion.fromString("8.19.0")));
assertThat(NodeEnvironment.getBestDowngradeVersion(BuildVersion.fromString("8.17.0")),
Matchers.equalTo(BuildVersion.fromString("8.18.0")));
assertThat(NodeEnvironment.getBestDowngradeVersion(BuildVersion.fromString("7.17.0")),
Matchers.equalTo(BuildVersion.fromString("8.18.0")));
assertThat(
NodeEnvironment.getBestDowngradeVersion(BuildVersion.fromString("8.18.0")),
Matchers.equalTo(BuildVersion.fromString("8.18.0"))
);
assertThat(
NodeEnvironment.getBestDowngradeVersion(BuildVersion.fromString("8.18.5")),
Matchers.equalTo(BuildVersion.fromString("8.18.5"))
);
assertThat(
NodeEnvironment.getBestDowngradeVersion(BuildVersion.fromString("8.18.12")),
Matchers.equalTo(BuildVersion.fromString("8.18.12"))
);
assertThat(
NodeEnvironment.getBestDowngradeVersion(BuildVersion.fromString("8.19.0")),
Matchers.equalTo(BuildVersion.fromString("8.19.0"))
);
assertThat(
NodeEnvironment.getBestDowngradeVersion(BuildVersion.fromString("8.17.0")),
Matchers.equalTo(BuildVersion.fromString("8.18.0"))
);
assertThat(
NodeEnvironment.getBestDowngradeVersion(BuildVersion.fromString("7.17.0")),
Matchers.equalTo(BuildVersion.fromString("8.18.0"))
);
}

private void verifyFailsOnShardData(Settings settings, Path indexPath, String shardDataDirName) {
Expand Down

0 comments on commit f458502

Please sign in to comment.