use of fixtures.header.models.HeaderResponseBoolHeaders in project autorest.java by Azure.
the class HeaderOperationsTests method responseBool.
@Test
public void responseBool() throws Exception {
lock = new CountDownLatch(1);
client.headers().responseBoolWithServiceResponseAsync("true").subscribe(new Action1<ServiceResponseWithHeaders<Void, HeaderResponseBoolHeaders>>() {
@Override
public void call(ServiceResponseWithHeaders<Void, HeaderResponseBoolHeaders> response) {
Headers headers = response.response().headers();
if (headers.get("value") != null) {
Assert.assertEquals("true", headers.get("value"));
lock.countDown();
}
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
fail();
}
});
Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS));
lock = new CountDownLatch(1);
client.headers().responseBoolWithServiceResponseAsync("false").subscribe(new Action1<ServiceResponseWithHeaders<Void, HeaderResponseBoolHeaders>>() {
@Override
public void call(ServiceResponseWithHeaders<Void, HeaderResponseBoolHeaders> response) {
Headers headers = response.response().headers();
if (headers.get("value") != null) {
Assert.assertEquals("false", headers.get("value"));
lock.countDown();
}
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
fail();
}
});
Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS));
}
Aggregations