@Test
public void testGetFileSetStatusTable() {

  when(mockZKManager.getFileSetInfoMap()).thenReturn(
      ImmutableMap.of(
          "fileset1", mockFileSetInfo1,
          "fileset2", mockFileSetInfo2,
          "fileset3", mockFileSetInfo3,
          "fileset4", mockFileSetInfo4
      )
  );
  when(mockZKManager.getViewInfo(eq("$fileset1$1234423233333"))).thenReturn(mockViewInfo1);
  when(mockZKManager.getViewInfo(eq("$fileset2$1344423233333"))).thenReturn(mockViewInfo2);
  when(mockZKManager.getViewInfo(eq("$fileset4$1344423233333"))).thenReturn(null);
  when(mockViewInfo1.getNumOnlinePartitions()).thenReturn(23);
  when(mockViewInfo2.getNumOnlinePartitions()).thenReturn(16);
  List<ClusterStatusServlet.FileSetWithErrorRow> fileSetsWithError =
      new ArrayList<ClusterStatusServlet.FileSetWithErrorRow>();
  List<ClusterStatusServlet.FileSetStatusRow> fileSets =
      ClusterStatusServlet.getFileSetStatusTable(mockZKManager, fileSetsWithError);
  assertEquals(2, fileSets.size());
  assertEquals(
      new ClusterStatusServlet.FileSetStatusRow("fileset1", 32, 23, "/fileset1/1234423233333"),
      fileSets.get(0)
  );
  assertEquals(
      new ClusterStatusServlet.FileSetStatusRow("fileset2", 16, 16, "/fileset2/1344423233333"),
      fileSets.get(1)
  );
  assertEquals(2, fileSetsWithError.size());
  assertEquals(
      new ClusterStatusServlet.FileSetWithErrorRow("fileset3",
          ClusterStatusServlet.FileSetError.NO_SERVING_INFO),
      fileSetsWithError.get(0)
  );
  assertEquals(
      new ClusterStatusServlet.FileSetWithErrorRow("fileset4",
          ClusterStatusServlet.FileSetError.NO_VIEW_INFO),
      fileSetsWithError.get(1)
  );
}