Search in sources :

Example 1 with HeaderResponseBoolHeaders

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));
}
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) HeaderResponseBoolHeaders(fixtures.header.models.HeaderResponseBoolHeaders) 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