src/test/java/edu/ucla/library/iiif/auth/handlers/AccessCookieHandlerIT.java
@Test
    public void testGetCookie(final Vertx aVertx, final VertxTestContext aContext) {
        final String requestUri =
                StringUtils.format(GET_COOKIE_PATH, URLEncoder.encode(TEST_ORIGIN, StandardCharsets.UTF_8));
        final HttpRequest<?> getCookie = myWebClient.get(myPort, TestConstants.INADDR_ANY, requestUri);

        getCookie.send().onSuccess(response -> {
            assertEquals(HTTP.OK, response.statusCode());
            assertEquals(MediaType.TEXT_HTML.toString(), response.headers().get(HttpHeaders.CONTENT_TYPE));
            assertEquals(1, response.cookies().size());

            aContext.completeNow();
        }).onFailure(aContext::failNow);
    }
/**
     * Tests that a client can obtain an access cookie.
     *
     * @param aVertx A Vert.x instance
     * @param aContext A test context
     */
Tests that a client can obtain an access cookie.
@param aVertx A Vert.x instance
@param aContext A test context
Tests that a client can obtain an access cookie . @param aVertx A Vert . x instance @param aContext A test context
@Test
    public void testGetCookie(final Vertx aVertx, final VertxTestContext aContext) {
        final String requestUri =
                StringUtils.format(GET_COOKIE_PATH, URLEncoder.encode(TEST_ORIGIN, StandardCharsets.UTF_8));
        final HttpRequest<?> getCookie = myWebClient.get(myPort, TestConstants.INADDR_ANY, requestUri);
        getCookie.send().onSuccess(response -> {
            assertEquals(HTTP.OK, response.statusCode());
            assertEquals(MediaType.TEXT_HTML.toString(), response.headers().get(HttpHeaders.CONTENT_TYPE));
            assertEquals(1, response.cookies().size());
            aContext.completeNow();
        }).onFailure(aContext::failNow);
    }
@ Test public void testGetCookie ( final Vertx aVertx , final VertxTestContext aContext ) { final String requestUri = StringUtils . format ( GET_COOKIE_PATH , URLEncoder . encode ( TEST_ORIGIN , StandardCharsets . UTF_8 ) ) ; final HttpRequest < ? > getCookie = myWebClient . get ( myPort , TestConstants . INADDR_ANY , requestUri ) ; getCookie . send ( ) . onSuccess ( response -> { assertEquals ( HTTP . OK , response . statusCode ( ) ) ; assertEquals ( MediaType . TEXT_HTML . toString ( ) , response . headers ( ) . get ( HttpHeaders . CONTENT_TYPE ) ) ; assertEquals ( 1 , response . cookies ( ) . size ( ) ) ; aContext . completeNow ( ) ; } ) . onFailure ( aContext :: failNow ) ; }
Tests that a client can obtain an access cookie.
Tests that a client can obtain an access cookie .