Search in sources :

Example 31 with ProductInner

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

the class LROSADsTests method postAsyncRelativeRetryInvalidJsonPolling.

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

Example 32 with ProductInner

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

the class LROSADsTests method put200InvalidJson.

@Test
public void put200InvalidJson() throws Exception {
    ProductInner product = new ProductInner();
    product.withLocation("West US");
    try {
        client.lROSADs().put200InvalidJson(product);
        fail();
    } catch (RuntimeException ex) {
        Assert.assertTrue(ex.getMessage().contains("Unexpected end-of-input"));
    }
}
Also used : ProductInner(fixtures.lro.implementation.ProductInner) Test(org.junit.Test)

Example 33 with ProductInner

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

the class LROSADsTests method post202NoLocation.

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

Example 34 with ProductInner

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

the class LROsTests method put200Succeeded.

@Test
public void put200Succeeded() throws Exception {
    ProductInner product = new ProductInner();
    product.withLocation("West US");
    ProductInner response = client.lROs().put200Succeeded(product);
    Assert.assertEquals("Succeeded", response.provisioningState());
}
Also used : ProductInner(fixtures.lro.implementation.ProductInner) SubProductInner(fixtures.lro.implementation.SubProductInner) Test(org.junit.Test)

Example 35 with ProductInner

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

the class LROsTests method deleteProvisioning202DeletingFailed200.

@Test
public void deleteProvisioning202DeletingFailed200() throws Exception {
    ProductInner response = client.lROs().deleteProvisioning202DeletingFailed200();
    Assert.assertEquals("Failed", response.provisioningState());
}
Also used : ProductInner(fixtures.lro.implementation.ProductInner) SubProductInner(fixtures.lro.implementation.SubProductInner) 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