@Test public void testProvideShouldReturnsMapWithoutNetworkWhenTheThereAreNoResponseFromGcp() throws IOException { when(computeInstancesMock.execute()).thenReturn(new InstanceList()); Map<String, Optional<NetworkInterface>> actual = underTest.provide(authenticatedContext, instances); assertEquals(3, actual.size()); assertFalse(actual.get(INSTANCE_NAME_1).isPresent()); assertFalse(actual.get(INSTANCE_NAME_2).isPresent()); assertFalse(actual.get(INSTANCE_NAME_3).isPresent()); }
Map<String, Optional<NetworkInterface>> provide(AuthenticatedContext authenticatedContext, List<CloudResource> instances) { String instanceNamePrefix = getInstanceNamePrefix(instances); List<Instance> gcpInstances = getInstances(authenticatedContext, instanceNamePrefix); return getNetworkMap(gcpInstances, instances); }
GcpNetworkInterfaceProvider { Map<String, Optional<NetworkInterface>> provide(AuthenticatedContext authenticatedContext, List<CloudResource> instances) { String instanceNamePrefix = getInstanceNamePrefix(instances); List<Instance> gcpInstances = getInstances(authenticatedContext, instanceNamePrefix); return getNetworkMap(gcpInstances, instances); } }
GcpNetworkInterfaceProvider { Map<String, Optional<NetworkInterface>> provide(AuthenticatedContext authenticatedContext, List<CloudResource> instances) { String instanceNamePrefix = getInstanceNamePrefix(instances); List<Instance> gcpInstances = getInstances(authenticatedContext, instanceNamePrefix); return getNetworkMap(gcpInstances, instances); }  }
GcpNetworkInterfaceProvider { Map<String, Optional<NetworkInterface>> provide(AuthenticatedContext authenticatedContext, List<CloudResource> instances) { String instanceNamePrefix = getInstanceNamePrefix(instances); List<Instance> gcpInstances = getInstances(authenticatedContext, instanceNamePrefix); return getNetworkMap(gcpInstances, instances); }  List<Instance> getInstances(AuthenticatedContext authenticatedContext, String instanceNamePrefix); }
GcpNetworkInterfaceProvider { Map<String, Optional<NetworkInterface>> provide(AuthenticatedContext authenticatedContext, List<CloudResource> instances) { String instanceNamePrefix = getInstanceNamePrefix(instances); List<Instance> gcpInstances = getInstances(authenticatedContext, instanceNamePrefix); return getNetworkMap(gcpInstances, instances); }  List<Instance> getInstances(AuthenticatedContext authenticatedContext, String instanceNamePrefix);  }