@Test
  public void testGetFileCopyGetMetaDataResponseExpectInterruptedException() throws Exception {
    // Arrange: Mock InterruptedException
    when(handler.getOperationRetryHandler().executeWithRetry(any(), anyString()))
        .thenThrow(new InterruptedException("Interrupted"));

    // Act: Call getFileCopyGetMetaDataResponse
    // Assert: A FileCopyHandlerException is thrown with the expected error code and message
    // Expected exception error code is FileCopyHandlerGetMetadataApiError
    try {
      handler.getFileCopyGetMetaDataResponse(fileCopyInfo);
      fail("Expected FileCopyHandlerException");
    } catch (FileCopyHandlerException e) {
      assertEquals(FileCopyHandlerException.FileCopyHandlerErrorCode.FileCopyHandlerGetMetadataApiError,
          e.getErrorCode());
      assertTrue(e.getMessage().contains("Thread interrupted while fetching metadata"));
      assertTrue(Thread.currentThread().isInterrupted()); // Ensure the interrupt flag is set
    }
  }
Test the {@link StoreFileCopyHandler#getFileCopyGetMetaDataResponse(FileCopyInfo)} method.
The test verifies that the method throws a {@link FileCopyHandlerException} with the expected error code and message.
The test simulates an {@link InterruptedException} during metadata retrieval.
@throws Exception
ambry-file-transfer/src/test/java/com/github/ambry/filetransfer/handler/StoreFileCopyHandlerTest.java