@@ -759,7 +759,7 @@ public void testRemotePersistedState() throws IOException {
759
759
final RemoteClusterStateService remoteClusterStateService = Mockito .mock (RemoteClusterStateService .class );
760
760
final ClusterMetadataManifest manifest = ClusterMetadataManifest .builder ().clusterTerm (1L ).stateVersion (5L ).build ();
761
761
final String previousClusterUUID = "prev-cluster-uuid" ;
762
- Mockito .when (remoteClusterStateService .writeFullMetadata (Mockito .any (), Mockito .any (), eq ( MANIFEST_CURRENT_CODEC_VERSION ) ))
762
+ Mockito .when (remoteClusterStateService .writeFullMetadata (Mockito .any (), Mockito .any ()))
763
763
.thenReturn (new RemoteClusterStateManifestInfo (manifest , "path/to/manifest" ));
764
764
765
765
Mockito .when (remoteClusterStateService .writeIncrementalMetadata (Mockito .any (), Mockito .any (), Mockito .any ()))
@@ -777,7 +777,7 @@ public void testRemotePersistedState() throws IOException {
777
777
);
778
778
779
779
remotePersistedState .setLastAcceptedState (clusterState );
780
- Mockito .verify (remoteClusterStateService ).writeFullMetadata (clusterState , previousClusterUUID , MANIFEST_CURRENT_CODEC_VERSION );
780
+ Mockito .verify (remoteClusterStateService ).writeFullMetadata (clusterState , previousClusterUUID );
781
781
782
782
assertThat (remotePersistedState .getLastAcceptedState (), equalTo (clusterState ));
783
783
assertThat (remotePersistedState .getCurrentTerm (), equalTo (clusterTerm ));
@@ -789,8 +789,7 @@ public void testRemotePersistedState() throws IOException {
789
789
);
790
790
791
791
remotePersistedState .setLastAcceptedState (secondClusterState );
792
- Mockito .verify (remoteClusterStateService , times (1 ))
793
- .writeFullMetadata (secondClusterState , previousClusterUUID , MANIFEST_CURRENT_CODEC_VERSION );
792
+ Mockito .verify (remoteClusterStateService , times (1 )).writeFullMetadata (secondClusterState , previousClusterUUID );
794
793
795
794
assertThat (remotePersistedState .getLastAcceptedState (), equalTo (secondClusterState ));
796
795
assertThat (remotePersistedState .getCurrentTerm (), equalTo (clusterTerm ));
@@ -820,9 +819,9 @@ public void testRemotePersistedStateWithDifferentNodeConfiguration() throws IOEx
820
819
.clusterTerm (1L )
821
820
.stateVersion (5L )
822
821
.codecVersion (CODEC_V1 )
823
- .opensearchVersion (Version .CURRENT )
822
+ .opensearchVersion (Version .V_2_15_0 )
824
823
.build ();
825
- Mockito .when (remoteClusterStateService .writeFullMetadata (Mockito .any (), Mockito .any (), eq ( CODEC_V1 ) ))
824
+ Mockito .when (remoteClusterStateService .writeFullMetadata (Mockito .any (), Mockito .any ()))
826
825
.thenReturn (new RemoteClusterStateManifestInfo (manifest , "path/to/manifest2" ));
827
826
828
827
CoordinationState .PersistedState remotePersistedState = new RemotePersistedState (remoteClusterStateService , previousClusterUUID );
@@ -833,7 +832,7 @@ public void testRemotePersistedStateWithDifferentNodeConfiguration() throws IOEx
833
832
);
834
833
remotePersistedState .setLastAcceptedState (clusterState1 );
835
834
836
- Mockito .verify (remoteClusterStateService ).writeFullMetadata (clusterState1 , previousClusterUUID , CODEC_V1 );
835
+ Mockito .verify (remoteClusterStateService ).writeFullMetadata (clusterState1 , previousClusterUUID );
837
836
838
837
ClusterState clusterState2 = createClusterState (
839
838
randomNonNegativeLong (),
@@ -846,10 +845,10 @@ public void testRemotePersistedStateWithDifferentNodeConfiguration() throws IOEx
846
845
.codecVersion (MANIFEST_CURRENT_CODEC_VERSION )
847
846
.opensearchVersion (Version .CURRENT )
848
847
.build ();
849
- Mockito .when (remoteClusterStateService .writeFullMetadata (Mockito .any (), Mockito .any (), eq ( MANIFEST_CURRENT_CODEC_VERSION ) ))
848
+ Mockito .when (remoteClusterStateService .writeFullMetadata (Mockito .any (), Mockito .any ()))
850
849
.thenReturn (new RemoteClusterStateManifestInfo (manifest2 , "path/to/manifest" ));
851
850
remotePersistedState .setLastAcceptedState (clusterState2 );
852
- Mockito .verify (remoteClusterStateService ).writeFullMetadata (clusterState2 , previousClusterUUID , MANIFEST_CURRENT_CODEC_VERSION );
851
+ Mockito .verify (remoteClusterStateService ).writeFullMetadata (clusterState2 , previousClusterUUID );
853
852
854
853
ClusterState clusterState3 = createClusterState (
855
854
randomNonNegativeLong (),
@@ -889,8 +888,7 @@ public void testRemotePersistentState_FollowerNode() throws IOException {
889
888
890
889
remotePersistedState .setLastAcceptedState (clusterState );
891
890
remotePersistedState .setLastAcceptedManifest (manifest );
892
- Mockito .verify (remoteClusterStateService , never ())
893
- .writeFullMetadata (clusterState , previousClusterUUID , MANIFEST_CURRENT_CODEC_VERSION );
891
+ Mockito .verify (remoteClusterStateService , never ()).writeFullMetadata (clusterState , previousClusterUUID );
894
892
895
893
assertEquals (clusterState , remotePersistedState .getLastAcceptedState ());
896
894
assertEquals (clusterTerm , remotePersistedState .getCurrentTerm ());
@@ -906,8 +904,7 @@ public void testRemotePersistentState_FollowerNode() throws IOException {
906
904
);
907
905
908
906
remotePersistedState .setLastAcceptedState (secondClusterState );
909
- Mockito .verify (remoteClusterStateService , never ())
910
- .writeFullMetadata (secondClusterState , previousClusterUUID , MANIFEST_CURRENT_CODEC_VERSION );
907
+ Mockito .verify (remoteClusterStateService , never ()).writeFullMetadata (secondClusterState , previousClusterUUID );
911
908
912
909
assertEquals (secondClusterState , remotePersistedState .getLastAcceptedState ());
913
910
assertEquals (clusterTerm , remotePersistedState .getCurrentTerm ());
@@ -940,7 +937,7 @@ public void testRemotePersistedStateNotCommitted() throws IOException {
940
937
.build ();
941
938
Mockito .when (remoteClusterStateService .getLatestClusterMetadataManifest (Mockito .any (), Mockito .any ()))
942
939
.thenReturn (Optional .of (manifest ));
943
- Mockito .when (remoteClusterStateService .writeFullMetadata (Mockito .any (), Mockito .any (), eq ( MANIFEST_CURRENT_CODEC_VERSION ) ))
940
+ Mockito .when (remoteClusterStateService .writeFullMetadata (Mockito .any (), Mockito .any ()))
944
941
.thenReturn (new RemoteClusterStateManifestInfo (manifest , "path/to/manifest" ));
945
942
946
943
Mockito .when (remoteClusterStateService .writeIncrementalMetadata (Mockito .any (), Mockito .any (), Mockito .any ()))
@@ -966,17 +963,14 @@ public void testRemotePersistedStateNotCommitted() throws IOException {
966
963
remotePersistedState .setLastAcceptedState (clusterState );
967
964
ArgumentCaptor <String > previousClusterUUIDCaptor = ArgumentCaptor .forClass (String .class );
968
965
ArgumentCaptor <ClusterState > clusterStateCaptor = ArgumentCaptor .forClass (ClusterState .class );
969
- Mockito .verify (remoteClusterStateService )
970
- .writeFullMetadata (clusterStateCaptor .capture (), previousClusterUUIDCaptor .capture (), eq (MANIFEST_CURRENT_CODEC_VERSION ));
966
+ Mockito .verify (remoteClusterStateService ).writeFullMetadata (clusterStateCaptor .capture (), previousClusterUUIDCaptor .capture ());
971
967
assertEquals (previousClusterUUID , previousClusterUUIDCaptor .getValue ());
972
968
}
973
969
974
970
public void testRemotePersistedStateExceptionOnFullStateUpload () throws IOException {
975
971
final RemoteClusterStateService remoteClusterStateService = Mockito .mock (RemoteClusterStateService .class );
976
972
final String previousClusterUUID = "prev-cluster-uuid" ;
977
- Mockito .doThrow (IOException .class )
978
- .when (remoteClusterStateService )
979
- .writeFullMetadata (Mockito .any (), Mockito .any (), eq (MANIFEST_CURRENT_CODEC_VERSION ));
973
+ Mockito .doThrow (IOException .class ).when (remoteClusterStateService ).writeFullMetadata (Mockito .any (), Mockito .any ());
980
974
981
975
CoordinationState .PersistedState remotePersistedState = new RemotePersistedState (remoteClusterStateService , previousClusterUUID );
982
976
@@ -994,9 +988,7 @@ public void testRemotePersistedStateFailureStats() throws IOException {
994
988
RemoteUploadStats remoteStateStats = new RemoteUploadStats ();
995
989
final RemoteClusterStateService remoteClusterStateService = Mockito .mock (RemoteClusterStateService .class );
996
990
final String previousClusterUUID = "prev-cluster-uuid" ;
997
- Mockito .doThrow (IOException .class )
998
- .when (remoteClusterStateService )
999
- .writeFullMetadata (Mockito .any (), Mockito .any (), eq (MANIFEST_CURRENT_CODEC_VERSION ));
991
+ Mockito .doThrow (IOException .class ).when (remoteClusterStateService ).writeFullMetadata (Mockito .any (), Mockito .any ());
1000
992
when (remoteClusterStateService .getUploadStats ()).thenReturn (remoteStateStats );
1001
993
doAnswer ((i ) -> {
1002
994
remoteStateStats .stateFailed ();
0 commit comments