Search in sources :

Example 1 with HeaderResponseByteHeaders

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));
}
Also used : HeaderResponseDatetimeHeaders(fixtures.header.models.HeaderResponseDatetimeHeaders) HeaderResponseEnumHeaders(fixtures.header.models.HeaderResponseEnumHeaders) HeaderResponseLongHeaders(fixtures.header.models.HeaderResponseLongHeaders) HeaderResponseProtectedKeyHeaders(fixtures.header.models.HeaderResponseProtectedKeyHeaders) Headers(okhttp3.Headers) HeaderResponseDurationHeaders(fixtures.header.models.HeaderResponseDurationHeaders) HeaderResponseDatetimeRfc1123Headers(fixtures.header.models.HeaderResponseDatetimeRfc1123Headers) ServiceResponseWithHeaders(com.microsoft.rest.ServiceResponseWithHeaders) HeaderResponseDateHeaders(fixtures.header.models.HeaderResponseDateHeaders) HeaderResponseByteHeaders(fixtures.header.models.HeaderResponseByteHeaders) HeaderResponseDoubleHeaders(fixtures.header.models.HeaderResponseDoubleHeaders) HeaderResponseBoolHeaders(fixtures.header.models.HeaderResponseBoolHeaders) HeaderResponseStringHeaders(fixtures.header.models.HeaderResponseStringHeaders) HeaderResponseExistingKeyHeaders(fixtures.header.models.HeaderResponseExistingKeyHeaders) HeaderResponseFloatHeaders(fixtures.header.models.HeaderResponseFloatHeaders) HeaderResponseIntegerHeaders(fixtures.header.models.HeaderResponseIntegerHeaders) CountDownLatch(java.util.concurrent.CountDownLatch) ServiceResponseWithHeaders(com.microsoft.rest.ServiceResponseWithHeaders) HeaderResponseByteHeaders(fixtures.header.models.HeaderResponseByteHeaders) Test(org.junit.Test)

Aggregations

ServiceResponseWithHeaders (com.microsoft.rest.ServiceResponseWithHeaders)1 HeaderResponseBoolHeaders (fixtures.header.models.HeaderResponseBoolHeaders)1 HeaderResponseByteHeaders (fixtures.header.models.HeaderResponseByteHeaders)1 HeaderResponseDateHeaders (fixtures.header.models.HeaderResponseDateHeaders)1 HeaderResponseDatetimeHeaders (fixtures.header.models.HeaderResponseDatetimeHeaders)1 HeaderResponseDatetimeRfc1123Headers (fixtures.header.models.HeaderResponseDatetimeRfc1123Headers)1 HeaderResponseDoubleHeaders (fixtures.header.models.HeaderResponseDoubleHeaders)1 HeaderResponseDurationHeaders (fixtures.header.models.HeaderResponseDurationHeaders)1 HeaderResponseEnumHeaders (fixtures.header.models.HeaderResponseEnumHeaders)1 HeaderResponseExistingKeyHeaders (fixtures.header.models.HeaderResponseExistingKeyHeaders)1 HeaderResponseFloatHeaders (fixtures.header.models.HeaderResponseFloatHeaders)1 HeaderResponseIntegerHeaders (fixtures.header.models.HeaderResponseIntegerHeaders)1 HeaderResponseLongHeaders (fixtures.header.models.HeaderResponseLongHeaders)1 HeaderResponseProtectedKeyHeaders (fixtures.header.models.HeaderResponseProtectedKeyHeaders)1 HeaderResponseStringHeaders (fixtures.header.models.HeaderResponseStringHeaders)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 Headers (okhttp3.Headers)1 Test (org.junit.Test)1