use of fixtures.lro.implementation.ProductInner in project autorest.java by Azure.
the class LROsTests method put202Retry200Async.
@Ignore("Can cause flakiness - only run manually")
public void put202Retry200Async() throws Exception {
final CountDownLatch lock = new CountDownLatch(1);
long startTime = System.currentTimeMillis();
final long[] callbackTime = new long[1];
ProductInner product = new ProductInner();
product.withLocation("West US");
client.getAzureClient().setLongRunningOperationRetryTimeout(1);
client.lROs().put202Retry200Async(product, new ServiceCallback<ProductInner>() {
@Override
public void failure(Throwable t) {
fail();
}
@Override
public void success(ProductInner result) {
Assert.assertEquals("100", result.id());
callbackTime[0] = System.currentTimeMillis();
lock.countDown();
}
});
long endTime = System.currentTimeMillis();
Assert.assertTrue(500 > endTime - startTime);
Assert.assertTrue(lock.await(3000, TimeUnit.MILLISECONDS));
client.getAzureClient().setLongRunningOperationRetryTimeout(0);
Assert.assertTrue(1000 < callbackTime[0] - startTime);
}
use of fixtures.lro.implementation.ProductInner in project autorest.java by Azure.
the class LROsTests method post202Retry200.
@Test
public void post202Retry200() throws Exception {
ProductInner product = new ProductInner();
product.withLocation("West US");
client.lROs().post202Retry200(product);
}
use of fixtures.lro.implementation.ProductInner in project autorest.java by Azure.
the class LROsTests method put200AsyncSucceeded.
@Test
public void put200AsyncSucceeded() throws Exception {
ProductInner product = new ProductInner();
product.withLocation("West US");
ProductInner response = client.lROs().put200SucceededAsync(product, null).get();
Assert.assertEquals("Succeeded", response.provisioningState());
}
use of fixtures.lro.implementation.ProductInner in project autorest.java by Azure.
the class LROsTests method putAsyncNoRetrySucceeded.
@Test
public void putAsyncNoRetrySucceeded() throws Exception {
ProductInner product = new ProductInner();
product.withLocation("West US");
ProductInner response = client.lROs().putAsyncNoRetrySucceeded(product);
Assert.assertEquals("Succeeded", response.provisioningState());
}
use of fixtures.lro.implementation.ProductInner in project autorest.java by Azure.
the class LROsTests method put200SucceededNoState.
@Test
public void put200SucceededNoState() throws Exception {
ProductInner product = new ProductInner();
product.withLocation("West US");
ProductInner response = client.lROs().put200SucceededNoState(product);
Assert.assertEquals("100", response.id());
}
Aggregations