@@ -536,12 +536,8 @@ public void testTimeoutWhileWritingManifestFile() throws IOException {
536536 anyList ()
537537 )
538538 ).thenReturn (new RemoteClusterStateUtils .UploadedMetadataResults ());
539- try {
540- spiedService .writeFullMetadata (clusterState , randomAlphaOfLength (10 ));
541- } catch (Exception e ) {
542- assertTrue (e instanceof RemoteStateTransferException );
543- assertTrue (e .getMessage ().contains ("Timed out waiting for transfer of manifest file to complete" ));
544- }
539+ RemoteStateTransferException ex = expectThrows (RemoteStateTransferException .class , () -> spiedService .writeFullMetadata (clusterState , randomAlphaOfLength (10 )));
540+ assertTrue (ex .getMessage ().contains ("Timed out waiting for transfer of manifest file to complete" ));
545541 }
546542
547543 public void testWriteFullMetadataInParallelFailureForIndexMetadata () throws IOException {
@@ -835,9 +831,9 @@ public void testGetClusterStateForManifest_ExcludeEphemeral() throws IOException
835831 remoteClusterStateService .setRemoteIndexMetadataManager (mockedIndexManager );
836832 remoteClusterStateService .setRemoteGlobalMetadataManager (mockedGlobalMetadataManager );
837833 remoteClusterStateService .setRemoteClusterStateAttributesManager (mockedClusterStateAttributeManager );
838- RemoteClusterStateService mockService = spy (remoteClusterStateService );
839- mockService .getClusterStateForManifest (ClusterName .DEFAULT .value (), manifest , NODE_ID , false );
840- verify (mockService , times (1 )).readClusterStateInParallel (
834+ RemoteClusterStateService spiedService = spy (remoteClusterStateService );
835+ spiedService .getClusterStateForManifest (ClusterName .DEFAULT .value (), manifest , NODE_ID , false );
836+ verify (spiedService , times (1 )).readClusterStateInParallel (
841837 any (),
842838 eq (manifest ),
843839 eq (manifest .getClusterUUID ()),
0 commit comments