@Test
public void testDeleteInfrastructureEnvironmentInstance() throws Exception {

    Network net = new Network("NET", "vdc", "region");
    tier.addNetwork(net);
    TierInstance tierInstance = new TierInstance();
    tierInstance.setTier(tier);
    tierInstance.addNetworkInstance(net.toNetworkInstance());
    Set<Tier> lTier = new HashSet<Tier>();
    lTier.add(tier);
    Environment env = new Environment("name", "description", lTier);
    EnvironmentInstance envInst = new EnvironmentInstance("blue", "des", env);
    String ovf = null;
    tierInstance.setOvf(ovf);
    tierInstance.setVapp("vapp");
    tierInstance.setVM(vm);
    envInst.addTierInstance(tierInstance);
    when(claudiaClient.existsVMReplica(any(ClaudiaData.class), any(String.class), any(VM.class), anyString()))
            .thenReturn(true);
    Mockito.doNothing().when(claudiaClient).undeployVMReplica(any(ClaudiaData.class), any(TierInstance.class));
    Mockito.doNothing().when(networkInstanceManager)
            .delete(any(ClaudiaData.class), any(NetworkInstance.class), anyString());
    when(tierInstanceManager.loadNetworkInstnace(any(String.class))).thenReturn(tierInstance);
    manager.deleteEnvironment(claudiaData, envInst);
}