@Test public void testSetHostsOnMachinesDoesNothingIPIsNull() { TestApplication app = TestApplication.Factory.newManagedInstanceForTests(); SshMachineLocation location = mock(SshMachineLocation.class); TagSupport tagSupport = mock(TestTagSupport.class); when(location.tags()).thenReturn(tagSupport); List<Entity> entities = Lists.newArrayList( entityWithCustomLocation(app, "a.example.com", null, location)); EtcHostsManager.setHostsOnMachines(entities, Attributes.ADDRESS); verify(location, never()).execCommands(anyString(), anyList()); }
public static void setHostsOnMachines(Iterable<? extends Entity> machines) { setHostsOnMachines(machines, Attributes.SUBNET_ADDRESS); }
EtcHostsManager { public static void setHostsOnMachines(Iterable<? extends Entity> machines) { setHostsOnMachines(machines, Attributes.SUBNET_ADDRESS); } }
EtcHostsManager { public static void setHostsOnMachines(Iterable<? extends Entity> machines) { setHostsOnMachines(machines, Attributes.SUBNET_ADDRESS); } private  EtcHostsManager(); }
EtcHostsManager { public static void setHostsOnMachines(Iterable<? extends Entity> machines) { setHostsOnMachines(machines, Attributes.SUBNET_ADDRESS); } private  EtcHostsManager(); static void setHostsOnMachines(Iterable<? extends Entity> machines); static void setHostsOnMachines(Iterable<? extends Entity> machines, AttributeSensor<String> addressSensor); static Map<String, String> gatherIpHostnameMapping(Iterable<? extends Entity> entities); static Map<String, String> gatherIpHostnameMapping(Iterable<? extends Entity> entities, AttributeSensor<String> addressSensor); }
EtcHostsManager { public static void setHostsOnMachines(Iterable<? extends Entity> machines) { setHostsOnMachines(machines, Attributes.SUBNET_ADDRESS); } private  EtcHostsManager(); static void setHostsOnMachines(Iterable<? extends Entity> machines); static void setHostsOnMachines(Iterable<? extends Entity> machines, AttributeSensor<String> addressSensor); static Map<String, String> gatherIpHostnameMapping(Iterable<? extends Entity> entities); static Map<String, String> gatherIpHostnameMapping(Iterable<? extends Entity> entities, AttributeSensor<String> addressSensor);  }