Search in sources :

Example 21 with CloudException

use of com.microsoft.azure.CloudException in project autorest.java by Azure.

the class LROSADsTests method putAsyncRelativeRetry400.

@Test
public void putAsyncRelativeRetry400() throws Exception {
    ProductInner product = new ProductInner();
    product.withLocation("West US");
    try {
        client.lROSADs().putAsyncRelativeRetry400(product);
        fail();
    } catch (CloudException ex) {
        Assert.assertEquals(400, ex.response().code());
    }
}
Also used : CloudException(com.microsoft.azure.CloudException) ProductInner(fixtures.lro.implementation.ProductInner) Test(org.junit.Test)

Example 22 with CloudException

use of com.microsoft.azure.CloudException in project autorest.java by Azure.

the class LROSADsTests method putAsyncRelativeRetryNoStatus.

@Test
public void putAsyncRelativeRetryNoStatus() throws Exception {
    ProductInner product = new ProductInner();
    product.withLocation("West US");
    try {
        client.lROSADs().putAsyncRelativeRetryNoStatus(product);
        fail();
    } catch (CloudException ex) {
        Assert.assertEquals(200, ex.response().code());
        Assert.assertTrue(ex.getMessage().contains("does not contain a valid body"));
    }
}
Also used : CloudException(com.microsoft.azure.CloudException) ProductInner(fixtures.lro.implementation.ProductInner) Test(org.junit.Test)

Example 23 with CloudException

use of com.microsoft.azure.CloudException in project autorest.java by Azure.

the class LROSADsTests method postAsyncRelativeRetry400.

@Test
public void postAsyncRelativeRetry400() throws Exception {
    ProductInner product = new ProductInner();
    product.withLocation("West US");
    try {
        client.lROSADs().postAsyncRelativeRetry400(product);
        fail();
    } catch (CloudException ex) {
        Assert.assertEquals(400, ex.response().code());
    }
}
Also used : CloudException(com.microsoft.azure.CloudException) ProductInner(fixtures.lro.implementation.ProductInner) Test(org.junit.Test)

Example 24 with CloudException

use of com.microsoft.azure.CloudException in project autorest.java by Azure.

the class LROSADsTests method putError201NoProvisioningStatePayload.

@Test
public void putError201NoProvisioningStatePayload() throws Exception {
    ProductInner product = new ProductInner();
    product.withLocation("West US");
    try {
        client.lROSADs().putError201NoProvisioningStatePayload(product);
        fail();
    } catch (CloudException ex) {
        Assert.assertEquals(200, ex.response().code());
        Assert.assertTrue(ex.getMessage().contains("does not contain a valid body"));
    }
}
Also used : CloudException(com.microsoft.azure.CloudException) ProductInner(fixtures.lro.implementation.ProductInner) Test(org.junit.Test)

Example 25 with CloudException

use of com.microsoft.azure.CloudException in project autorest.java by Azure.

the class LROSADsTests method postAsyncRelativeRetryNoPayload.

@Test
public void postAsyncRelativeRetryNoPayload() throws Exception {
    ProductInner product = new ProductInner();
    product.withLocation("West US");
    try {
        client.lROSADs().postAsyncRelativeRetryNoPayload(product);
        fail();
    } catch (CloudException ex) {
        Assert.assertEquals(200, ex.response().code());
        Assert.assertTrue(ex.getMessage().contains("does not contain a valid body"));
    }
}
Also used : CloudException(com.microsoft.azure.CloudException) ProductInner(fixtures.lro.implementation.ProductInner) Test(org.junit.Test)

Aggregations

CloudException (com.microsoft.azure.CloudException)35 Test (org.junit.Test)20 ProductInner (fixtures.lro.implementation.ProductInner)17 SubProductInner (fixtures.lro.implementation.SubProductInner)6 ArrayList (java.util.ArrayList)6 CloudError (com.microsoft.azure.CloudError)5 AzureClient (com.sequenceiq.cloudbreak.cloud.azure.client.AzureClient)5 CloudConnectorException (com.sequenceiq.cloudbreak.cloud.exception.CloudConnectorException)5 HashMap (java.util.HashMap)5 CloudResource (com.sequenceiq.cloudbreak.cloud.model.CloudResource)4 AzureCredentialView (com.sequenceiq.cloudbreak.cloud.azure.view.AzureCredentialView)3 ActionWentFailException (com.sequenceiq.cloudbreak.service.Retry.ActionWentFailException)3 VirtualMachine (com.microsoft.azure.management.compute.VirtualMachine)2 AddressSpace (com.microsoft.azure.management.network.AddressSpace)2 NetworkInterface (com.microsoft.azure.management.network.NetworkInterface)2 SubnetInner (com.microsoft.azure.management.network.implementation.SubnetInner)2 VirtualNetworkInner (com.microsoft.azure.management.network.implementation.VirtualNetworkInner)2 Deployment (com.microsoft.azure.management.resources.Deployment)2 ResourceGroup (com.microsoft.azure.management.resources.ResourceGroup)2 Region (com.microsoft.azure.management.resources.fluentcore.arm.Region)2