@Test public void testConvertShouldReturnNullWhenTheStackDoesNotHaveAssignedNetwork() { when(stack.getNetwork()).thenReturn(null); NetworkV4Response result = underTest.convert(stack); assertNull(result); }
@Override public NetworkV4Response convert(Stack source) { NetworkV4Response networkResp = null; Network network = source.getNetwork(); if (network != null) { networkResp = new NetworkV4Response(); networkResp.setSubnetCIDR(network.getSubnetCIDR()); if (network.getAttributes() != null) { Map<String, Object> parameters = cleanMap(network.getAttributes().getMap()); putNetworkResourcesIntoResponse(source, parameters); providerParameterCalculator.parse(parameters, networkResp); } } return networkResp; }
NetworkToNetworkV4ResponseConverter extends AbstractConversionServiceAwareConverter<Stack, NetworkV4Response> { @Override public NetworkV4Response convert(Stack source) { NetworkV4Response networkResp = null; Network network = source.getNetwork(); if (network != null) { networkResp = new NetworkV4Response(); networkResp.setSubnetCIDR(network.getSubnetCIDR()); if (network.getAttributes() != null) { Map<String, Object> parameters = cleanMap(network.getAttributes().getMap()); putNetworkResourcesIntoResponse(source, parameters); providerParameterCalculator.parse(parameters, networkResp); } } return networkResp; } }
NetworkToNetworkV4ResponseConverter extends AbstractConversionServiceAwareConverter<Stack, NetworkV4Response> { @Override public NetworkV4Response convert(Stack source) { NetworkV4Response networkResp = null; Network network = source.getNetwork(); if (network != null) { networkResp = new NetworkV4Response(); networkResp.setSubnetCIDR(network.getSubnetCIDR()); if (network.getAttributes() != null) { Map<String, Object> parameters = cleanMap(network.getAttributes().getMap()); putNetworkResourcesIntoResponse(source, parameters); providerParameterCalculator.parse(parameters, networkResp); } } return networkResp; }  }
NetworkToNetworkV4ResponseConverter extends AbstractConversionServiceAwareConverter<Stack, NetworkV4Response> { @Override public NetworkV4Response convert(Stack source) { NetworkV4Response networkResp = null; Network network = source.getNetwork(); if (network != null) { networkResp = new NetworkV4Response(); networkResp.setSubnetCIDR(network.getSubnetCIDR()); if (network.getAttributes() != null) { Map<String, Object> parameters = cleanMap(network.getAttributes().getMap()); putNetworkResourcesIntoResponse(source, parameters); providerParameterCalculator.parse(parameters, networkResp); } } return networkResp; }  @Override NetworkV4Response convert(Stack source); }
NetworkToNetworkV4ResponseConverter extends AbstractConversionServiceAwareConverter<Stack, NetworkV4Response> { @Override public NetworkV4Response convert(Stack source) { NetworkV4Response networkResp = null; Network network = source.getNetwork(); if (network != null) { networkResp = new NetworkV4Response(); networkResp.setSubnetCIDR(network.getSubnetCIDR()); if (network.getAttributes() != null) { Map<String, Object> parameters = cleanMap(network.getAttributes().getMap()); putNetworkResourcesIntoResponse(source, parameters); providerParameterCalculator.parse(parameters, networkResp); } } return networkResp; }  @Override NetworkV4Response convert(Stack source);  }