Search in sources :

Example 1 with ProductInner

use of fixtures.lro.implementation.ProductInner in project autorest.java by Azure.

the class LROSADsTests method putNonRetry201Creating400.

@Test
public void putNonRetry201Creating400() throws Exception {
    ProductInner product = new ProductInner();
    product.withLocation("West US");
    try {
        client.lROSADs().putNonRetry201Creating400(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 2 with ProductInner

use of fixtures.lro.implementation.ProductInner 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());
    }
}
Also used : CloudException(com.microsoft.azure.CloudException) ProductInner(fixtures.lro.implementation.ProductInner) Test(org.junit.Test)

Example 3 with ProductInner

use of fixtures.lro.implementation.ProductInner 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"));
    }
}
Also used : CloudException(com.microsoft.azure.CloudException) ProductInner(fixtures.lro.implementation.ProductInner) Test(org.junit.Test)

Example 4 with ProductInner

use of fixtures.lro.implementation.ProductInner 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());
    }
}
Also used : CloudException(com.microsoft.azure.CloudException) ProductInner(fixtures.lro.implementation.ProductInner) Test(org.junit.Test)

Example 5 with ProductInner

use of fixtures.lro.implementation.ProductInner in project autorest.java by Azure.

the class LROSADsTests method putAsyncRelativeRetryInvalidJsonPolling.

@Test
public void putAsyncRelativeRetryInvalidJsonPolling() throws Exception {
    ProductInner product = new ProductInner();
    product.withLocation("West US");
    try {
        client.lROSADs().putAsyncRelativeRetryInvalidJsonPolling(product);
        fail();
    } catch (RuntimeException ex) {
        Assert.assertTrue(ex.getMessage().contains("does not contain a valid body"));
    }
}
Also used : ProductInner(fixtures.lro.implementation.ProductInner) Test(org.junit.Test)

Aggregations

ProductInner (fixtures.lro.implementation.ProductInner)51 Test (org.junit.Test)46 SubProductInner (fixtures.lro.implementation.SubProductInner)25 CloudException (com.microsoft.azure.CloudException)17 Ignore (org.junit.Ignore)5 CountDownLatch (java.util.concurrent.CountDownLatch)1