Search in sources :

Example 6 with LoadBalancerInner

use of com.microsoft.azure.management.network.implementation.LoadBalancerInner in project photon-model by vmware.

the class AzureLoadBalancerServiceTest method testDeleteLoadBalancer.

@Test
public void testDeleteLoadBalancer() throws Throwable {
    LoadBalancerState loadBalancerState = provisionLoadBalancer(TaskStage.FINISHED, null);
    startLoadBalancerProvisioning(LoadBalancerInstanceRequest.InstanceRequestType.DELETE, loadBalancerState, TaskStage.FINISHED);
    // verify load balancer state was deleted
    try {
        getLoadBalancerState(this.host, loadBalancerState.documentSelfLink);
    } catch (Throwable e) {
        assertTrue(e instanceof ServiceHost.ServiceNotFoundException);
    }
    if (!this.isMock) {
        // Verify that the load balancer was deleted from Azure.
        LoadBalancerInner sgResponse = this.loadBalancerClient.getByResourceGroup(this.rgName, this.loadBalancerName);
        if (sgResponse != null) {
            fail("Load Balancer should not exist in Azure.");
        }
    }
}
Also used : LoadBalancerInner(com.microsoft.azure.management.network.implementation.LoadBalancerInner) LoadBalancerState(com.vmware.photon.controller.model.resources.LoadBalancerService.LoadBalancerState) AzureBaseTest(com.vmware.photon.controller.model.adapters.azure.base.AzureBaseTest) Test(org.junit.Test)

Aggregations

LoadBalancerInner (com.microsoft.azure.management.network.implementation.LoadBalancerInner)6 AzureBaseTest (com.vmware.photon.controller.model.adapters.azure.base.AzureBaseTest)4 LoadBalancerState (com.vmware.photon.controller.model.resources.LoadBalancerService.LoadBalancerState)4 Test (org.junit.Test)4 LoadBalancersInner (com.microsoft.azure.management.network.implementation.LoadBalancersInner)1 ServiceCallback (com.microsoft.rest.ServiceCallback)1 AzureDeferredResultServiceCallback (com.vmware.photon.controller.model.adapters.azure.utils.AzureDeferredResultServiceCallback)1 AzureProvisioningCallback (com.vmware.photon.controller.model.adapters.azure.utils.AzureProvisioningCallback)1