use of fixtures.header.models.HeaderResponseDatetimeRfc1123Headers in project autorest.java by Azure.
the class HeaderOperationsTests method responseDatetimeRfc1123.
@Test
public void responseDatetimeRfc1123() throws Exception {
lock = new CountDownLatch(1);
client.headers().responseDatetimeRfc1123WithServiceResponseAsync("valid").subscribe(new Action1<ServiceResponseWithHeaders<Void, HeaderResponseDatetimeRfc1123Headers>>() {
@Override
public void call(ServiceResponseWithHeaders<Void, HeaderResponseDatetimeRfc1123Headers> response) {
Headers headers = response.response().headers();
if (headers.get("value") != null) {
Assert.assertEquals("Fri, 01 Jan 2010 12:34:56 GMT", headers.get("value"));
lock.countDown();
}
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
fail();
}
});
Assert.assertTrue(lock.await(100000, TimeUnit.MILLISECONDS));
lock = new CountDownLatch(1);
client.headers().responseDatetimeRfc1123WithServiceResponseAsync("min").subscribe(new Action1<ServiceResponseWithHeaders<Void, HeaderResponseDatetimeRfc1123Headers>>() {
@Override
public void call(ServiceResponseWithHeaders<Void, HeaderResponseDatetimeRfc1123Headers> response) {
Headers headers = response.response().headers();
if (headers.get("value") != null) {
Assert.assertEquals("Mon, 01 Jan 0001 00:00:00 GMT", headers.get("value"));
lock.countDown();
}
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
fail();
}
});
Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS));
}
Aggregations