use of fixtures.header.models.HeaderResponseDatetimeHeaders in project autorest.java by Azure.
the class HeaderOperationsTests method responseDatetime.
@Test
public void responseDatetime() throws Exception {
lock = new CountDownLatch(1);
client.headers().responseDatetimeWithServiceResponseAsync("valid").subscribe(new Action1<ServiceResponseWithHeaders<Void, HeaderResponseDatetimeHeaders>>() {
@Override
public void call(ServiceResponseWithHeaders<Void, HeaderResponseDatetimeHeaders> response) {
Headers headers = response.response().headers();
if (headers.get("value") != null) {
Assert.assertEquals("2010-01-01T12:34:56Z", 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().responseDatetimeWithServiceResponseAsync("min").subscribe(new Action1<ServiceResponseWithHeaders<Void, HeaderResponseDatetimeHeaders>>() {
@Override
public void call(ServiceResponseWithHeaders<Void, HeaderResponseDatetimeHeaders> response) {
Headers headers = response.response().headers();
if (headers.get("value") != null) {
Assert.assertEquals("0001-01-01T00:00:00Z", headers.get("value"));
lock.countDown();
}
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
fail();
}
});
Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS));
}
Aggregations