@Test
  public void testGetSSIReturnsCorrectSCMSnapshotIndexPair() {
    String storeName = "storeName";
    String otherStoreName = "otherStoreName";
    Set<String> storesToBackupOrRestore = ImmutableSet.of(storeName, otherStoreName);
    String storeSnapshotIndexBlobId = "snapshotIndexBlobId";
    String otherStoreSnapshotIndexBlobId = "otherSnapshotIndexBlobId";
    SnapshotIndex mockStoreSnapshotIndex = mock(SnapshotIndex.class);
    SnapshotIndex mockOtherStooreSnapshotIndex = mock(SnapshotIndex.class);

    CheckpointV2 checkpoint = createCheckpointV2(BlobStoreStateBackendFactory.class.getName(),
        ImmutableMap.of(storeName, storeSnapshotIndexBlobId, otherStoreName, otherStoreSnapshotIndexBlobId));

    BlobStoreUtil mockBlobStoreUtil = mock(BlobStoreUtil.class);

    when(mockBlobStoreUtil.getSnapshotIndex(eq(storeSnapshotIndexBlobId), any(Metadata.class), any(Boolean.class))).thenReturn(
        CompletableFuture.completedFuture(mockStoreSnapshotIndex));
    when(mockBlobStoreUtil.getSnapshotIndex(eq(otherStoreSnapshotIndexBlobId), any(Metadata.class), any(Boolean.class))).thenReturn(
        CompletableFuture.completedFuture(mockOtherStooreSnapshotIndex));
    when(mockBlobStoreUtil.getStoreSnapshotIndexes(anyString(), anyString(), anyString(),
        any(Checkpoint.class), anySetOf(String.class), any(Boolean.class))).thenCallRealMethod();

    Map<String, Pair<String, SnapshotIndex>> snapshotIndexes =
        mockBlobStoreUtil.getStoreSnapshotIndexes("testJobName", "testJobId", "taskName",
            checkpoint, storesToBackupOrRestore, false);

    assertEquals(storeSnapshotIndexBlobId, snapshotIndexes.get(storeName).getKey());
    assertEquals(mockStoreSnapshotIndex, snapshotIndexes.get(storeName).getValue());
    assertEquals(otherStoreSnapshotIndexBlobId, snapshotIndexes.get(otherStoreName).getKey());
    assertEquals(mockOtherStooreSnapshotIndex, snapshotIndexes.get(otherStoreName).getValue());
    verify(mockBlobStoreUtil, times(2)).getSnapshotIndex(anyString(), any(Metadata.class), any(Boolean.class));
  }
Tests related to {@link BlobStoreUtil#getStoreSnapshotIndexes}
samza-core/src/test/java/org/apache/samza/storage/blobstore/util/TestBlobStoreUtil.java