@Override
  public Stream<FileSlice> getLatestUnCompactedFileSlices(String partitionPath) {
    return execute(partitionPath, preferredView::getLatestUnCompactedFileSlices,
        (path) -> getSecondaryView().getLatestUnCompactedFileSlices(path));
  }
@Test
  public void testGetLatestUnCompactedFileSlices() {
    Stream<FileSlice> actual;
    Stream<FileSlice> expected = testFileSliceStream;
    String partitionPath = "/table2";

    when(primary.getLatestUnCompactedFileSlices(partitionPath)).thenReturn(testFileSliceStream);
    actual = fsView.getLatestUnCompactedFileSlices(partitionPath);
    assertEquals(expected, actual);
    verify(secondaryViewSupplier, never()).get();

    resetMocks();
    when(secondaryViewSupplier.get()).thenReturn(secondary);
    when(primary.getLatestUnCompactedFileSlices(partitionPath)).thenThrow(new RuntimeException());
    when(secondary.getLatestUnCompactedFileSlices(partitionPath)).thenReturn(testFileSliceStream);
    actual = fsView.getLatestUnCompactedFileSlices(partitionPath);
    assertEquals(expected, actual);

    resetMocks();
    when(secondary.getLatestUnCompactedFileSlices(partitionPath)).thenReturn(testFileSliceStream);
    actual = fsView.getLatestUnCompactedFileSlices(partitionPath);
    assertEquals(expected, actual);

    resetMocks();
    when(secondary.getLatestUnCompactedFileSlices(partitionPath)).thenThrow(new RuntimeException());
    assertThrows(RuntimeException.class, () -> {
      fsView.getLatestUnCompactedFileSlices(partitionPath);
    });
  }