File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
server/src/test/java/org/opensearch/gateway/remote Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1344,8 +1344,8 @@ public void testReadClusterStateInParallel_ExceptionDuringRead() throws IOExcept
13441344 ClusterState previousClusterState = generateClusterStateWithAllAttributes ().build ();
13451345 ClusterMetadataManifest manifest = generateClusterMetadataManifestWithAllAttributes ().build ();
13461346 BlobContainer container = mockBlobStoreObjects ();
1347- Exception mockException = new IOException ( "mock exception" ) ;
1348- when (container .readBlob (anyString ())).thenThrow ( mockException );
1347+ String exceptionMsg = "mock exception" ;
1348+ when (container .readBlob (anyString ())).thenAnswer ( inv -> { throw new IOException ( exceptionMsg ); } );
13491349 remoteClusterStateService .start ();
13501350 RemoteStateTransferException exception = expectThrows (
13511351 RemoteStateTransferException .class ,
@@ -1371,7 +1371,7 @@ public void testReadClusterStateInParallel_ExceptionDuringRead() throws IOExcept
13711371 );
13721372 assertEquals ("Exception during reading cluster state from remote" , exception .getMessage ());
13731373 assertTrue (exception .getSuppressed ().length > 0 );
1374- assertEquals (mockException , exception .getSuppressed ()[0 ].getCause ());
1374+ assertEquals (exceptionMsg , exception .getSuppressed ()[0 ].getCause (). getMessage ());
13751375 }
13761376
13771377 public void testReadClusterStateInParallel_UnexpectedResult () throws IOException {
You can’t perform that action at this time.
0 commit comments