File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
main/java/org/opensearch/index/reindex/remote
test/java/org/opensearch/index/reindex/remote Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,10 @@ public int compareTo(RemoteVersion other) {
9696 return 1 ;
9797 }
9898
99+ if (this .isOpenSearch != other .isOpenSearch ) {
100+ return this .isOpenSearch ? 1 : -1 ;
101+ }
102+
99103 int result = Integer .compare (this .major , other .major );
100104 if (result != 0 ) {
101105 return result ;
Original file line number Diff line number Diff line change @@ -36,9 +36,11 @@ public void testVersionComparison() {
3636 // Test compareTo()
3737 assertTrue (RemoteVersion .ELASTICSEARCH_1_0_0 .compareTo (RemoteVersion .ELASTICSEARCH_2_0_0 ) < 0 );
3838 assertTrue (RemoteVersion .ELASTICSEARCH_2_0_0 .compareTo (RemoteVersion .ELASTICSEARCH_1_0_0 ) > 0 );
39+ assertTrue (RemoteVersion .ELASTICSEARCH_2_0_0 .compareTo (RemoteVersion .ELASTICSEARCH_2_0_0 ) == 0 );
3940
4041 // Test OpenSearch vs Elasticsearch versions with same numbers
41- assertEquals (0 , RemoteVersion .ELASTICSEARCH_2_0_0 .compareTo (RemoteVersion .OPENSEARCH_2_0_0 ));
42+ assertTrue (RemoteVersion .ELASTICSEARCH_2_0_0 .compareTo (RemoteVersion .OPENSEARCH_2_0_0 ) < 0 );
43+ assertTrue (RemoteVersion .OPENSEARCH_2_0_0 .compareTo (RemoteVersion .ELASTICSEARCH_2_0_0 ) > 0 );
4244 }
4345
4446 public void testVersionFromString () {
You can’t perform that action at this time.
0 commit comments