use of fixtures.header.models.HeaderResponseByteHeaders in project autorest.java by Azure.
the class HeaderOperationsTests method responseByte.
@Test
public void responseByte() throws Exception {
lock = new CountDownLatch(1);
client.headers().responseByteWithServiceResponseAsync("valid").subscribe(new Action1<ServiceResponseWithHeaders<Void, HeaderResponseByteHeaders>>() {
@Override
public void call(ServiceResponseWithHeaders<Void, HeaderResponseByteHeaders> response) {
Headers headers = response.response().headers();
if (headers.get("value") != null) {
byte[] value = Base64.decodeBase64(headers.get("value"));
String actual = new String(value, Charset.forName("UTF-8"));
Assert.assertEquals("啊齄丂狛狜隣郎隣兀﨩", actual);
lock.countDown();
}
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
fail();
}
});
Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS));
}
Aggregations