@Test
public void getDirectory() throws Exception {

  CachingDiscoveryProvider provider = createNonExpiringProvider();
  setupNormalMockDelegate();
  // Make the same call twice and ensure that the delegate is only called once.
  assertThat(provider.getDirectory(ROOT)).isEqualTo(DIRECTORY);
  assertThat(provider.getDirectory(ROOT)).isEqualTo(DIRECTORY);
  verify(delegate, times(1)).getDirectory(ROOT);
}