Search in sources :

Example 1 with HeaderResponseDatetimeRfc1123Headers

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));
}
Also used : HeaderResponseDatetimeRfc1123Headers(fixtures.header.models.HeaderResponseDatetimeRfc1123Headers) 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) 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