@@ -759,7 +759,7 @@ public void testRemotePersistedState() throws IOException {
759759 final RemoteClusterStateService remoteClusterStateService = Mockito .mock (RemoteClusterStateService .class );
760760 final ClusterMetadataManifest manifest = ClusterMetadataManifest .builder ().clusterTerm (1L ).stateVersion (5L ).build ();
761761 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 ()))
763763 .thenReturn (new RemoteClusterStateManifestInfo (manifest , "path/to/manifest" ));
764764
765765 Mockito .when (remoteClusterStateService .writeIncrementalMetadata (Mockito .any (), Mockito .any (), Mockito .any ()))
@@ -777,7 +777,7 @@ public void testRemotePersistedState() throws IOException {
777777 );
778778
779779 remotePersistedState .setLastAcceptedState (clusterState );
780- Mockito .verify (remoteClusterStateService ).writeFullMetadata (clusterState , previousClusterUUID , MANIFEST_CURRENT_CODEC_VERSION );
780+ Mockito .verify (remoteClusterStateService ).writeFullMetadata (clusterState , previousClusterUUID );
781781
782782 assertThat (remotePersistedState .getLastAcceptedState (), equalTo (clusterState ));
783783 assertThat (remotePersistedState .getCurrentTerm (), equalTo (clusterTerm ));
@@ -789,8 +789,7 @@ public void testRemotePersistedState() throws IOException {
789789 );
790790
791791 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 );
794793
795794 assertThat (remotePersistedState .getLastAcceptedState (), equalTo (secondClusterState ));
796795 assertThat (remotePersistedState .getCurrentTerm (), equalTo (clusterTerm ));
@@ -820,9 +819,9 @@ public void testRemotePersistedStateWithDifferentNodeConfiguration() throws IOEx
820819 .clusterTerm (1L )
821820 .stateVersion (5L )
822821 .codecVersion (CODEC_V1 )
823- .opensearchVersion (Version .CURRENT )
822+ .opensearchVersion (Version .V_2_15_0 )
824823 .build ();
825- Mockito .when (remoteClusterStateService .writeFullMetadata (Mockito .any (), Mockito .any (), eq ( CODEC_V1 ) ))
824+ Mockito .when (remoteClusterStateService .writeFullMetadata (Mockito .any (), Mockito .any ()))
826825 .thenReturn (new RemoteClusterStateManifestInfo (manifest , "path/to/manifest2" ));
827826
828827 CoordinationState .PersistedState remotePersistedState = new RemotePersistedState (remoteClusterStateService , previousClusterUUID );
@@ -833,7 +832,7 @@ public void testRemotePersistedStateWithDifferentNodeConfiguration() throws IOEx
833832 );
834833 remotePersistedState .setLastAcceptedState (clusterState1 );
835834
836- Mockito .verify (remoteClusterStateService ).writeFullMetadata (clusterState1 , previousClusterUUID , CODEC_V1 );
835+ Mockito .verify (remoteClusterStateService ).writeFullMetadata (clusterState1 , previousClusterUUID );
837836
838837 ClusterState clusterState2 = createClusterState (
839838 randomNonNegativeLong (),
@@ -846,10 +845,10 @@ public void testRemotePersistedStateWithDifferentNodeConfiguration() throws IOEx
846845 .codecVersion (MANIFEST_CURRENT_CODEC_VERSION )
847846 .opensearchVersion (Version .CURRENT )
848847 .build ();
849- Mockito .when (remoteClusterStateService .writeFullMetadata (Mockito .any (), Mockito .any (), eq ( MANIFEST_CURRENT_CODEC_VERSION ) ))
848+ Mockito .when (remoteClusterStateService .writeFullMetadata (Mockito .any (), Mockito .any ()))
850849 .thenReturn (new RemoteClusterStateManifestInfo (manifest2 , "path/to/manifest" ));
851850 remotePersistedState .setLastAcceptedState (clusterState2 );
852- Mockito .verify (remoteClusterStateService ).writeFullMetadata (clusterState2 , previousClusterUUID , MANIFEST_CURRENT_CODEC_VERSION );
851+ Mockito .verify (remoteClusterStateService ).writeFullMetadata (clusterState2 , previousClusterUUID );
853852
854853 ClusterState clusterState3 = createClusterState (
855854 randomNonNegativeLong (),
@@ -889,8 +888,7 @@ public void testRemotePersistentState_FollowerNode() throws IOException {
889888
890889 remotePersistedState .setLastAcceptedState (clusterState );
891890 remotePersistedState .setLastAcceptedManifest (manifest );
892- Mockito .verify (remoteClusterStateService , never ())
893- .writeFullMetadata (clusterState , previousClusterUUID , MANIFEST_CURRENT_CODEC_VERSION );
891+ Mockito .verify (remoteClusterStateService , never ()).writeFullMetadata (clusterState , previousClusterUUID );
894892
895893 assertEquals (clusterState , remotePersistedState .getLastAcceptedState ());
896894 assertEquals (clusterTerm , remotePersistedState .getCurrentTerm ());
@@ -906,8 +904,7 @@ public void testRemotePersistentState_FollowerNode() throws IOException {
906904 );
907905
908906 remotePersistedState .setLastAcceptedState (secondClusterState );
909- Mockito .verify (remoteClusterStateService , never ())
910- .writeFullMetadata (secondClusterState , previousClusterUUID , MANIFEST_CURRENT_CODEC_VERSION );
907+ Mockito .verify (remoteClusterStateService , never ()).writeFullMetadata (secondClusterState , previousClusterUUID );
911908
912909 assertEquals (secondClusterState , remotePersistedState .getLastAcceptedState ());
913910 assertEquals (clusterTerm , remotePersistedState .getCurrentTerm ());
@@ -940,7 +937,7 @@ public void testRemotePersistedStateNotCommitted() throws IOException {
940937 .build ();
941938 Mockito .when (remoteClusterStateService .getLatestClusterMetadataManifest (Mockito .any (), Mockito .any ()))
942939 .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 ()))
944941 .thenReturn (new RemoteClusterStateManifestInfo (manifest , "path/to/manifest" ));
945942
946943 Mockito .when (remoteClusterStateService .writeIncrementalMetadata (Mockito .any (), Mockito .any (), Mockito .any ()))
@@ -966,17 +963,14 @@ public void testRemotePersistedStateNotCommitted() throws IOException {
966963 remotePersistedState .setLastAcceptedState (clusterState );
967964 ArgumentCaptor <String > previousClusterUUIDCaptor = ArgumentCaptor .forClass (String .class );
968965 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 ());
971967 assertEquals (previousClusterUUID , previousClusterUUIDCaptor .getValue ());
972968 }
973969
974970 public void testRemotePersistedStateExceptionOnFullStateUpload () throws IOException {
975971 final RemoteClusterStateService remoteClusterStateService = Mockito .mock (RemoteClusterStateService .class );
976972 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 ());
980974
981975 CoordinationState .PersistedState remotePersistedState = new RemotePersistedState (remoteClusterStateService , previousClusterUUID );
982976
@@ -994,9 +988,7 @@ public void testRemotePersistedStateFailureStats() throws IOException {
994988 RemoteUploadStats remoteStateStats = new RemoteUploadStats ();
995989 final RemoteClusterStateService remoteClusterStateService = Mockito .mock (RemoteClusterStateService .class );
996990 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 ());
1000992 when (remoteClusterStateService .getUploadStats ()).thenReturn (remoteStateStats );
1001993 doAnswer ((i ) -> {
1002994 remoteStateStats .stateFailed ();
0 commit comments