@Test
public void testReadFields() throws IOException {

  long length = 11111;
  long fileCount = 22222;
  long directoryCount = 33333;
  long quota = 44444;
  long spaceConsumed = 55555;
  long spaceQuota = 66666;
  ContentSummary contentSummary = new ContentSummary.Builder().build();
  DataInput in = mock(DataInput.class);
  when(in.readLong()).thenReturn(length).thenReturn(fileCount)
      .thenReturn(directoryCount).thenReturn(quota).thenReturn(spaceConsumed)
      .thenReturn(spaceQuota);
  contentSummary.readFields(in);
  assertEquals("getLength", length, contentSummary.getLength());
  assertEquals("getFileCount", fileCount, contentSummary.getFileCount());
  assertEquals("getDirectoryCount", directoryCount,
      contentSummary.getDirectoryCount());
  assertEquals("getQuota", quota, contentSummary.getQuota());
  assertEquals("getSpaceConsumed", spaceConsumed,
      contentSummary.getSpaceConsumed());
  assertEquals("getSpaceQuota", spaceQuota, contentSummary.getSpaceQuota());
}