Search in sources :

Example 41 with ProductInner

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

the class LROsTests method putAsyncRetryFailed.

@Test
public void putAsyncRetryFailed() throws Exception {
    ProductInner product = new ProductInner();
    product.withLocation("West US");
    try {
        ProductInner response = client.lROs().putAsyncRetryFailed(product);
        fail();
    } catch (CloudException e) {
        Assert.assertEquals("Async operation failed with provisioning state: Failed", e.getMessage());
    }
}
Also used : CloudException(com.microsoft.azure.CloudException) ProductInner(fixtures.lro.implementation.ProductInner) SubProductInner(fixtures.lro.implementation.SubProductInner) Test(org.junit.Test)

Example 42 with ProductInner

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

the class LROsTests method postAsyncRetrySucceeded.

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

Example 43 with ProductInner

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

the class LROsTests method put200SucceededAsync.

@Test
public void put200SucceededAsync() throws Exception {
    ProductInner product = new ProductInner();
    product.withLocation("West US");
    Observable.from(client.lROs().put200SucceededAsync(product, null)).subscribe(new Subscriber<ProductInner>() {

        @Override
        public void onCompleted() {
            System.out.println("completed");
        }

        @Override
        public void onError(Throwable e) {
            System.out.println("error" + e);
        }

        @Override
        public void onNext(ProductInner productInnerServiceResponse) {
            System.out.println(productInnerServiceResponse.provisioningState());
        }
    });
    System.out.println("Checkpoint");
}
Also used : ProductInner(fixtures.lro.implementation.ProductInner) SubProductInner(fixtures.lro.implementation.SubProductInner) Test(org.junit.Test)

Example 44 with ProductInner

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

the class LROsTests method put201CreatingFailed200.

@Test
public void put201CreatingFailed200() throws Exception {
    ProductInner product = new ProductInner();
    product.withLocation("West US");
    try {
        ProductInner response = client.lROs().put201CreatingFailed200(product);
        fail();
    } catch (CloudException e) {
        Assert.assertEquals("Async operation failed with provisioning state: Failed", e.getMessage());
    }
}
Also used : CloudException(com.microsoft.azure.CloudException) ProductInner(fixtures.lro.implementation.ProductInner) SubProductInner(fixtures.lro.implementation.SubProductInner) Test(org.junit.Test)

Example 45 with ProductInner

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

the class LRORetrysTests method putAsyncRelativeRetrySucceeded.

@Test
public void putAsyncRelativeRetrySucceeded() throws Exception {
    ProductInner product = new ProductInner();
    product.withLocation("West US");
    ProductInner response = client.lRORetrys().putAsyncRelativeRetrySucceeded(product);
    Assert.assertEquals("Succeeded", response.provisioningState());
}
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