Search in sources :

Example 26 with ProductInner

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

the class LROSADsTests method post202RetryInvalidHeader.

@Test
public void post202RetryInvalidHeader() throws Exception {
    ProductInner product = new ProductInner();
    product.withLocation("West US");
    try {
        client.lROSADs().post202RetryInvalidHeader(product);
        fail();
    } catch (NumberFormatException ex) {
        Assert.assertEquals("For input string: \"/bar\"", ex.getMessage());
    }
}
Also used : ProductInner(fixtures.lro.implementation.ProductInner) Test(org.junit.Test)

Example 27 with ProductInner

use of fixtures.lro.implementation.ProductInner 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 28 with ProductInner

use of fixtures.lro.implementation.ProductInner 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 29 with ProductInner

use of fixtures.lro.implementation.ProductInner 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 30 with ProductInner

use of fixtures.lro.implementation.ProductInner 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

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