Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rjernst committed Sep 6, 2023
1 parent 520aa4a commit 6b56871
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package org.elasticsearch.cluster.version;

import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable;
Expand Down Expand Up @@ -44,7 +45,7 @@ public static CompatibilityVersions minimumVersions(Map<String, CompatibilityVer
.map(CompatibilityVersions::transportVersion)
.min(Comparator.naturalOrder())
// In practice transportVersions is always nonempty (except in tests) but use a conservative default anyway:
.orElse(TransportVersion.MINIMUM_COMPATIBLE)
.orElse(TransportVersions.MINIMUM_COMPATIBLE)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package org.elasticsearch.cluster.version;

import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.TransportVersionUtils;

Expand All @@ -21,10 +22,10 @@ public class CompatibilityVersionsTests extends ESTestCase {
public void testMinimumVersions() {
assertThat(
CompatibilityVersions.minimumVersions(Map.of()),
equalTo(new CompatibilityVersions(TransportVersion.MINIMUM_COMPATIBLE))
equalTo(new CompatibilityVersions(TransportVersions.MINIMUM_COMPATIBLE))
);

TransportVersion version1 = TransportVersionUtils.getNextVersion(TransportVersion.MINIMUM_COMPATIBLE, true);
TransportVersion version1 = TransportVersionUtils.getNextVersion(TransportVersions.MINIMUM_COMPATIBLE, true);
TransportVersion version2 = TransportVersionUtils.randomVersionBetween(
random(),
TransportVersionUtils.getNextVersion(version1, true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public void testGetPersistableSafeSecurityHeaders() throws IOException {
final ClusterState clusterState = mock(ClusterState.class);
final DiscoveryNodes discoveryNodes = mock(DiscoveryNodes.class);
when(clusterState.nodes()).thenReturn(discoveryNodes);
when(clusterState.getMinTransportVersion()).thenReturn(TransportVersion.MINIMUM_COMPATIBLE);
when(clusterState.getMinTransportVersion()).thenReturn(TransportVersions.MINIMUM_COMPATIBLE);
// No security header
ThreadContext threadContext = new ThreadContext(Settings.EMPTY);
final String nonSecurityHeaderKey = "not-a-security-header";
Expand Down

0 comments on commit 6b56871

Please sign in to comment.