Search in sources :

Example 1 with HeaderResponseDatetimeHeaders

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

the class HeaderOperationsTests method responseDatetime.

@Test
public void responseDatetime() throws Exception {
    lock = new CountDownLatch(1);
    client.headers().responseDatetimeWithServiceResponseAsync("valid").subscribe(new Action1<ServiceResponseWithHeaders<Void, HeaderResponseDatetimeHeaders>>() {

        @Override
        public void call(ServiceResponseWithHeaders<Void, HeaderResponseDatetimeHeaders> response) {
            Headers headers = response.response().headers();
            if (headers.get("value") != null) {
                Assert.assertEquals("2010-01-01T12:34:56Z", 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().responseDatetimeWithServiceResponseAsync("min").subscribe(new Action1<ServiceResponseWithHeaders<Void, HeaderResponseDatetimeHeaders>>() {

        @Override
        public void call(ServiceResponseWithHeaders<Void, HeaderResponseDatetimeHeaders> response) {
            Headers headers = response.response().headers();
            if (headers.get("value") != null) {
                Assert.assertEquals("0001-01-01T00:00:00Z", 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) HeaderResponseDatetimeHeaders(fixtures.header.models.HeaderResponseDatetimeHeaders) 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