@Test public void testOneFailedDeletion() throws FreeIpaClientException { Set<String> hosts = Set.of("host1", "host2"); Host host1 = new Host(); host1.setFqdn("host1"); Host host2 = new Host(); host2.setFqdn("host2"); when(freeIpaClient.findAllHost()).thenReturn(Set.of(host1, host2)); when(freeIpaClient.deleteHost(host2.getFqdn())).thenThrow(new FreeIpaClientException("not handled")); Pair<Set<String>, Map<String, String>> result = underTest.removeHosts(freeIpaClient, hosts); assertEquals(1, result.getFirst().size()); assertEquals(1, result.getSecond().size()); assertTrue(result.getFirst().contains(host1.getFqdn())); assertTrue(result.getSecond().keySet().contains(host2.getFqdn())); assertTrue(result.getSecond().values().contains("not handled")); }
public Pair<Set<String>, Map<String, String>> removeHosts(FreeIpaClient client, Set<String> hosts) throws FreeIpaClientException { return removeHosts(client, hosts, false); }
HostDeletionService { public Pair<Set<String>, Map<String, String>> removeHosts(FreeIpaClient client, Set<String> hosts) throws FreeIpaClientException { return removeHosts(client, hosts, false); } }
HostDeletionService { public Pair<Set<String>, Map<String, String>> removeHosts(FreeIpaClient client, Set<String> hosts) throws FreeIpaClientException { return removeHosts(client, hosts, false); }  }
HostDeletionService { public Pair<Set<String>, Map<String, String>> removeHosts(FreeIpaClient client, Set<String> hosts) throws FreeIpaClientException { return removeHosts(client, hosts, false); }  Pair<Set<String>, Map<String, String>> removeHosts(FreeIpaClient client, Set<String> hosts); Pair<Set<String>, Map<String, String>> removeServers(FreeIpaClient client, Set<String> hosts); void deleteHostsWithDeleteException(FreeIpaClient client, Set<String> hosts); }
HostDeletionService { public Pair<Set<String>, Map<String, String>> removeHosts(FreeIpaClient client, Set<String> hosts) throws FreeIpaClientException { return removeHosts(client, hosts, false); }  Pair<Set<String>, Map<String, String>> removeHosts(FreeIpaClient client, Set<String> hosts); Pair<Set<String>, Map<String, String>> removeServers(FreeIpaClient client, Set<String> hosts); void deleteHostsWithDeleteException(FreeIpaClient client, Set<String> hosts);  }