@Override
  public Stream<HoodieBaseFile> getAllBaseFiles(String partitionPath) {
    return execute(partitionPath, preferredView::getAllBaseFiles, (path) -> getSecondaryView().getAllBaseFiles(path));
  }
@Test
  public void testGetAllBaseFiles() {
    Stream<HoodieBaseFile> actual;
    Stream<HoodieBaseFile> expected = testBaseFileStream;
    String partitionPath = "/table2";

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

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

    resetMocks();
    when(secondary.getAllBaseFiles(partitionPath)).thenReturn(testBaseFileStream);
    actual = fsView.getAllBaseFiles(partitionPath);
    assertEquals(expected, actual);

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