@Test
void testKeyValueLoadConfigFindAllThrowsException() throws Exception {

  KeyValueConfigName n1 = new KeyValueConfigName(g1, collectionName);
  KeyValueConfigName n2 = new KeyValueConfigName(g2, collectionName);
  KeyValueConfigName root = new KeyValueConfigName(null, collectionName);
  KeyValueConfigEntity entity1 = new KeyValueConfigEntity("p1", "v1", n1);
  KeyValueConfigEntity entity2 = new KeyValueConfigEntity("p2", "v2", n2);
  doReturn(ImmutableList.of(entity1)).when(repository).findAll(n1);
  doReturn(ImmutableList.of(entity2)).when(repository).findAll(n2);
  doThrow(new RuntimeException("some exception")).when(repository).findAll(root);
  Map<String, ConfigProperty> config = configSource.loadConfig();
  assertEquals(2, config.size());
  assertEquals("v1", config.get("p1").valueAsString().get());
  assertEquals("v2", config.get("p2").valueAsString().get());
}