Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions server/src/test/java/org/elasticsearch/TransportVersionTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@

public class TransportVersionTests extends ESTestCase {

/**
* This test is specific for V9, to ensure that transport versions are backported correctly.
*/
public void testMaximumAllowedTransportVersion() {
assertThat(
TransportVersions.LATEST_DEFINED.onOrBefore(TransportVersions.ELASTICSEARCH_9_0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this check achieving? The latest will never be before a known transport constant, and if it would only be equal if there are no patches yet, but isPatchFrom would return true in that case anyways, so I think this is redundant.

|| TransportVersions.LATEST_DEFINED.isPatchFrom(TransportVersions.ELASTICSEARCH_9_0),
is(true)
);
}

public void testVersionComparison() {
TransportVersion V_8_2_0 = TransportVersions.V_8_2_0;
TransportVersion V_8_16_0 = TransportVersions.V_8_16_0;
Expand Down