use of com.cloud.network.vpc.VpcService in project cloudstack by apache.
the class AclOnPrivateGwTest method testExecuteFail.
@Test
public void testExecuteFail() {
VpcService vpcService = Mockito.mock(VpcService.class);
createPrivateGwCmd._vpcService = vpcService;
try {
Mockito.when(vpcService.applyVpcPrivateGateway(Matchers.anyLong(), Matchers.anyBoolean())).thenReturn(null);
} catch (ResourceUnavailableException e) {
e.printStackTrace();
} catch (ConcurrentOperationException e) {
e.printStackTrace();
}
try {
createPrivateGwCmd.execute();
} catch (ServerApiException exception) {
Assert.assertEquals("Failed to create private gateway", exception.getDescription());
} catch (ResourceAllocationException e) {
e.printStackTrace();
} catch (InsufficientCapacityException e) {
e.printStackTrace();
} catch (ConcurrentOperationException e) {
e.printStackTrace();
} catch (ResourceUnavailableException e) {
e.printStackTrace();
}
}
use of com.cloud.network.vpc.VpcService in project cosmic by MissionCriticalCloud.
the class AclOnPrivateGwTest method testExecuteFail.
@Test
public void testExecuteFail() {
final VpcService vpcService = Mockito.mock(VpcService.class);
createPrivateGwCmd._vpcService = vpcService;
try {
Mockito.when(vpcService.applyVpcPrivateGateway(Matchers.anyLong(), Matchers.anyBoolean())).thenReturn(null);
} catch (final ResourceUnavailableException e) {
e.printStackTrace();
} catch (final ConcurrentOperationException e) {
e.printStackTrace();
}
try {
createPrivateGwCmd.execute();
} catch (final ServerApiException exception) {
Assert.assertEquals("Failed to create private gateway", exception.getDescription());
} catch (final ResourceAllocationException e) {
e.printStackTrace();
} catch (final InsufficientCapacityException e) {
e.printStackTrace();
} catch (final ConcurrentOperationException e) {
e.printStackTrace();
} catch (final ResourceUnavailableException e) {
e.printStackTrace();
}
}
Aggregations