@Test
  public void testCheckpointErrors() throws Exception {
    // Corrupted checkpoint
    mockCheckpointDownload(true, "You can't do this!");
    Map<String, Long> checkpoints = azureStorageCompactor.getCompactionProgress(partitionPath);
    assertEquals(AzureStorageCompactor.emptyCheckpoints, checkpoints);
    assertEquals(1, azureMetrics.compactionProgressReadErrorCount.getCount());

    // Upload error
    mockCheckpointDownload(false, null);
    BlobStorageException ex = mockStorageException(BlobErrorCode.CONTAINER_DISABLED);
    when(mockBlockBlobAsyncClient.uploadWithResponse(any(), anyLong(), any(), any(), any(), any(), any())).thenReturn(
        Mono.error(ex));
    long now = System.currentTimeMillis();
    azureStorageCompactor.updateCompactionProgress(partitionPath, CloudBlobMetadata.FIELD_DELETION_TIME, now);
    assertEquals(1, azureMetrics.compactionProgressWriteErrorCount.getCount());
  }
Test compaction progress methods, error cases
ambry-cloud/src/test/java/com/github/ambry/cloud/azure/AzureStorageCompactorTest.java