Network network = mock(Network.class);
when(network.getBroadcastDomainType()).thenReturn(BroadcastDomainType.Lswitch);
when(network.getId()).thenReturn(42L);
when(network.getPhysicalNetworkId()).thenReturn(42L);
NetworkOffering offering = mock(NetworkOffering.class);
when(offering.getId()).thenReturn(42L);
when(offering.getTrafficType()).thenReturn(TrafficType.Guest);
when(offering.getGuestType()).thenReturn(GuestType.Isolated);
List<PublicIpAddress> ipAddresses = new ArrayList<PublicIpAddress>();
PublicIpAddress pipReleased = mock(PublicIpAddress.class);
PublicIpAddress pipAllocated = mock(PublicIpAddress.class);
Ip ipReleased = new Ip("42.10.10.10");