use of com.microsoft.azure.CloudException in project autorest.java by Azure.
the class LROSADsTests method putNonRetry400.
@Test
public void putNonRetry400() throws Exception {
ProductInner product = new ProductInner();
product.withLocation("West US");
try {
client.lROSADs().putNonRetry400(product);
fail();
} catch (CloudException ex) {
Assert.assertEquals(400, ex.response().code());
}
}
use of com.microsoft.azure.CloudException in project autorest.java by Azure.
the class LROSADsTests method putAsyncRelativeRetryNoStatusPayload.
@Test
public void putAsyncRelativeRetryNoStatusPayload() throws Exception {
ProductInner product = new ProductInner();
product.withLocation("West US");
try {
client.lROSADs().putAsyncRelativeRetryNoStatusPayload(product);
fail();
} catch (CloudException ex) {
Assert.assertEquals(200, ex.response().code());
Assert.assertTrue(ex.getMessage().contains("does not contain a valid body"));
}
}
use of com.microsoft.azure.CloudException in project autorest.java by Azure.
the class LROSADsTests method postNonRetry400.
@Test
public void postNonRetry400() throws Exception {
ProductInner product = new ProductInner();
product.withLocation("West US");
try {
client.lROSADs().postNonRetry400(product);
fail();
} catch (CloudException ex) {
Assert.assertEquals(400, ex.response().code());
}
}
use of com.microsoft.azure.CloudException in project autorest.java by Azure.
the class LROsTests method postAsyncRetrycanceled.
@Test
public void postAsyncRetrycanceled() throws Exception {
try {
ProductInner product = new ProductInner();
product.withLocation("West US");
client.lROs().postAsyncRetrycanceled(product);
fail();
} catch (CloudException e) {
Assert.assertEquals("Async operation failed with provisioning state: Canceled", e.getMessage());
}
}
use of com.microsoft.azure.CloudException in project autorest.java by Azure.
the class LROsTests method putAsyncNoRetrycanceled.
@Test
public void putAsyncNoRetrycanceled() throws Exception {
ProductInner product = new ProductInner();
product.withLocation("West US");
try {
ProductInner response = client.lROs().putAsyncNoRetrycanceled(product);
fail();
} catch (CloudException e) {
Assert.assertEquals("Async operation failed with provisioning state: Canceled", e.getMessage());
}
}
Aggregations