Skip to content

Commit

Permalink
make V_3_0_0 package private and reuse in test
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Walter Knize <[email protected]>
  • Loading branch information
nknize committed Jan 14, 2022
1 parent 0830a2c commit 2601e64
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ final class TransportHandshaker {
private final HandshakeRequestSender handshakeRequestSender;

// @todo remove in 3.0.0
private static final Version V_3_0_0 = Version.fromId(3000099 ^ Version.MASK);
static final Version V_3_0_0 = Version.fromId(3000099 ^ Version.MASK);

TransportHandshaker(Version version, ThreadPool threadPool, HandshakeRequestSender handshakeRequestSender) {
this.version = version;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@

import static java.util.Collections.emptyMap;
import static java.util.Collections.emptySet;
import static org.opensearch.transport.TransportHandshaker.V_3_0_0;
import static org.opensearch.transport.TransportService.NOOP_TRANSPORT_INTERCEPTOR;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.empty;
Expand Down Expand Up @@ -2229,9 +2230,7 @@ public void testHandshakeUpdatesVersion() throws IOException {
// OpenSearch [1.0:3.0) in bwc mode should only "upgrade" to Legacy v7.10.2
assertEquals(
connection.getVersion(),
version.onOrAfter(Version.V_1_0_0) && version.before(Version.fromId(3000099 ^ Version.MASK))
? LegacyESVersion.V_7_10_2
: version
version.onOrAfter(Version.V_1_0_0) && version.before(V_3_0_0) ? LegacyESVersion.V_7_10_2 : version
);
}
}
Expand Down

0 comments on commit 2601e64

Please sign in to comment.