@Test
public void testDeleteNetworkWithoutEnv() throws Exception {

    Network net = new Network("NET", "vdc", "region");
    Network net2 = new Network("Internet", "vdc", "region");
    tier.addNetwork(net);
    tier.addNetwork(net2);
    TierInstance tierInstance = new TierInstance();
    tierInstance.setTier(tier);
    Environment env = new Environment("name", "description", null);
    env.addTier(tier);
    EnvironmentInstance envInst = new EnvironmentInstance("blue", "des", env);
    envInst.addTierInstance(tierInstance);
    String region = "RegionOne";
    when(tierInstanceManager.update(any(TierInstance.class))).thenReturn(tierInstance);
    when(networkInstanceManager.create(any(ClaudiaData.class), any(NetworkInstance.class), anyString()))
            .thenReturn(net.toNetworkInstance());
    Mockito.doThrow(EntityNotFoundException.class).when(networkInstanceManager)
            .load(any(String.class), any(ClaudiaData.class), any(String.class));
    manager.deleteNetworksInTierInstance(claudiaData, tierInstance);
    assertEquals(envInst.getTierInstances().get(0).getNetworkInstances().size(), 0);
}