Search in sources :

Example 1 with HeaderResponseExistingKeyHeaders

use of fixtures.header.models.HeaderResponseExistingKeyHeaders in project autorest.java by Azure.

the class HeaderOperationsTests method responseExistingKey.

@Test
public void responseExistingKey() throws Exception {
    lock = new CountDownLatch(1);
    client.headers().responseExistingKeyWithServiceResponseAsync().subscribe(new Action1<ServiceResponseWithHeaders<Void, HeaderResponseExistingKeyHeaders>>() {

        @Override
        public void call(ServiceResponseWithHeaders<Void, HeaderResponseExistingKeyHeaders> response) {
            Headers headers = response.response().headers();
            if (headers.get("User-Agent") != null) {
                Assert.assertEquals("overwrite", headers.get("User-Agent"));
                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) HeaderResponseExistingKeyHeaders(fixtures.header.models.HeaderResponseExistingKeyHeaders) 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