@Test
  public void testUpdateCosmosNotFound() throws Exception {
    mockBlobExistence(true);
    when(mockCosmosAsyncContainer.readItem(anyString(), any(), any())).thenReturn(
        Mono.error(mockNotFoundCosmosException));
    assertTrue("Expected update to recover",
        azureDest.deleteBlob(blobId, deletionTime, (short) 0, dummyCloudUpdateValidator));
    assertTrue("Expected update to recover", azureDest.undeleteBlob(blobId, (short) 0, dummyCloudUpdateValidator) == 0);
    try {
      azureDest.updateBlobExpiration(blobId, expirationTime, dummyCloudUpdateValidator);
    } catch (Exception ex) {
      fail("Expected update to recover");
    }
    verify(mockCosmosAsyncContainer, times(3)).upsertItem(any(), any(), any());
    assertEquals("Expected two recoveries", 3, azureMetrics.blobUpdateRecoverCount.getCount());
  }
Test update methods when record not found in Cosmos.
ambry-cloud/src/test/java/com/github/ambry/cloud/azure/AzureCloudDestinationTest.java