use of com.vmware.photon.controller.model.tasks.ProvisionLoadBalancerTaskService.ProvisionLoadBalancerTaskState in project photon-model by vmware.
the class AzureLoadBalancerServiceTest method testCreateLoadBalancerWithInvalidNICTarget.
@Test
public void testCreateLoadBalancerWithInvalidNICTarget() throws Throwable {
if (!this.isMock) {
LoadBalancerState loadBalancerState = createLoadBalancerState(this.loadBalancerName, LoadBalancerTargetType.INVALID);
ProvisionLoadBalancerTaskState provisionLoadBalancerTaskState = startLoadBalancerProvisioning(LoadBalancerInstanceRequest.InstanceRequestType.CREATE, loadBalancerState, TaskStage.FAILED);
assertTrue(provisionLoadBalancerTaskState.taskInfo.stage == TaskStage.FAILED);
assertEquals("java.lang.IllegalArgumentException: Invalid target type specified", provisionLoadBalancerTaskState.taskInfo.failure.message);
}
}
use of com.vmware.photon.controller.model.tasks.ProvisionLoadBalancerTaskService.ProvisionLoadBalancerTaskState in project photon-model by vmware.
the class AzureLoadBalancerServiceTest method startLoadBalancerProvisioning.
private ProvisionLoadBalancerTaskState startLoadBalancerProvisioning(LoadBalancerInstanceRequest.InstanceRequestType requestType, LoadBalancerState loadBalancerState, TaskStage expectedTaskState) throws Throwable {
ProvisionLoadBalancerTaskState taskState = new ProvisionLoadBalancerTaskState();
taskState.requestType = requestType;
taskState.loadBalancerLink = loadBalancerState.documentSelfLink;
taskState.isMockRequest = this.isMock;
// Start/Post lb provisioning task
taskState = postServiceSynchronously(FACTORY_LINK, taskState, ProvisionLoadBalancerTaskState.class);
// Wait for provisioning task to complete
return waitForServiceState(ProvisionLoadBalancerTaskState.class, taskState.documentSelfLink, liveState -> testServiceState(liveState, expectedTaskState));
}
use of com.vmware.photon.controller.model.tasks.ProvisionLoadBalancerTaskService.ProvisionLoadBalancerTaskState in project photon-model by vmware.
the class AWSLoadBalancerServiceTest method kickOffLoadBalancerProvision.
private ProvisionLoadBalancerTaskState kickOffLoadBalancerProvision(InstanceRequestType requestType, String loadBalancerLink, TaskStage expectedTaskState) throws Throwable {
ProvisionLoadBalancerTaskState taskState = new ProvisionLoadBalancerTaskState();
taskState.requestType = requestType;
taskState.loadBalancerLink = loadBalancerLink;
taskState.isMockRequest = this.isMock;
// Start/Post load balancer provisioning task
taskState = postServiceSynchronously(ProvisionLoadBalancerTaskService.FACTORY_LINK, taskState, ProvisionLoadBalancerTaskState.class);
// Wait for the task to complete
taskState = waitForFinishedTask(ProvisionLoadBalancerTaskState.class, taskState.documentSelfLink);
assertEquals(expectedTaskState, taskState.taskInfo.stage);
return taskState;
}
Aggregations