@Test
public void testDeployNetwork() throws Exception {

    Network net = new Network("NET", "vdc", "region");
    tier.addNetwork(net);
    TierInstance tierInstance = new TierInstance();
    tierInstance.setTier(tier);
    when(tierInstanceManager.update(any(TierInstance.class))).thenReturn(tierInstance);
    when(networkInstanceManager.create(any(ClaudiaData.class), any(NetworkInstance.class), anyString()))
            .thenReturn(net.toNetworkInstance());
    when(networkManager.load(any(String.class), any(String.class), any(String.class))).thenReturn(net);
    when(tierManager.loadTierWithNetworks(any(String.class), any(String.class), any(String.class)))
            .thenReturn(tier);
    Mockito.doThrow(EntityNotFoundException.class).when(networkInstanceManager)
            .load(any(String.class), any(ClaudiaData.class), any(String.class));
    manager.deployNetworks(claudiaData, tierInstance);
    assertEquals(tierInstance.getNetworkInstances().size(), 1);
}