@Override
  public void loadPartitions(List<String> partitionPaths) {
    execute(
        () -> {
          preferredView.loadPartitions(partitionPaths);
          return null;
        },
        () -> {
          getSecondaryView().loadPartitions(partitionPaths);
          return null;
        });
  }
@Test
  public void testLoadPartitions() {
    String partitionPath = "/table2";

    fsView.loadPartitions(Collections.singletonList(partitionPath));
    verify(primary, times(1)).loadPartitions(Collections.singletonList(partitionPath));
    verify(secondary, never()).loadPartitions(any());
    verify(secondaryViewSupplier, never()).get();

    resetMocks();
    when(secondaryViewSupplier.get()).thenReturn(secondary);
    doThrow(new RuntimeException()).when(primary).loadPartitions(Collections.singletonList(partitionPath));
    fsView.loadPartitions(Collections.singletonList(partitionPath));
    verify(primary, times(1)).loadPartitions(Collections.singletonList(partitionPath));
    verify(secondary, times(1)).loadPartitions(Collections.singletonList(partitionPath));

    resetMocks();
    doThrow(new RuntimeException()).when(secondary).loadPartitions(Collections.singletonList(partitionPath));
    assertThrows(RuntimeException.class, () -> {
      fsView.loadPartitions(Collections.singletonList(partitionPath));
    });
  }