src/test/java/edu/ucla/library/bucketeer/ImageLoadUsingKakaduIT.java
@Test
    public void testTiffImageLoad(final TestContext aContext) {
        Assume.assumeNotNull(System.getProperty(TestConstants.BUCKETEER_VERSION));

        final String imagePath = URLEncoder.encode(TEST_IMAGE_PATH, StandardCharsets.UTF_8);
        final String path = StringUtils.format(PATH, myImageID, imagePath);
        final WebClient webClient = WebClient.create(myVertx);
        final Async asyncTask = aContext.async();

        webClient.get(myPort, Constants.UNSPECIFIED_HOST, path).send(submission -> {
            if (submission.succeeded()) {
                final HttpResponse<Buffer> response = submission.result();
                final JsonObject body = response.bodyAsJsonObject();

                aContext.assertEquals(HTTP.CREATED, response.statusCode());
                aContext.assertEquals(TEST_IMAGE_PATH, body.getString(FILE_PATH));
                aContext.assertEquals(myImageID, body.getString(IMAGE_ID));

                TestUtils.complete(asyncTask);

            } else {
                aContext.fail(submission.cause());
            }
        });
    }
/**
     * Tests to make sure that an image can be converted and uploaded as expected.
     *
     * @param aContext A test context
     */
Tests to make sure that an image can be converted and uploaded as expected.
@param aContext A test context
Tests to make sure that an image can be converted and uploaded as expected . @param aContext A test context
@Test
    public void testTiffImageLoad(final TestContext aContext) {
        Assume.assumeNotNull(System.getProperty(TestConstants.BUCKETEER_VERSION));
        final String imagePath = URLEncoder.encode(TEST_IMAGE_PATH, StandardCharsets.UTF_8);
        final String path = StringUtils.format(PATH, myImageID, imagePath);
        final WebClient webClient = WebClient.create(myVertx);
        final Async asyncTask = aContext.async();
        webClient.get(myPort, Constants.UNSPECIFIED_HOST, path).send(submission -> {
            if (submission.succeeded()) {
                final HttpResponse<Buffer> response = submission.result();
                final JsonObject body = response.bodyAsJsonObject();
                aContext.assertEquals(HTTP.CREATED, response.statusCode());
                aContext.assertEquals(TEST_IMAGE_PATH, body.getString(FILE_PATH));
                aContext.assertEquals(myImageID, body.getString(IMAGE_ID));
                TestUtils.complete(asyncTask);
            } else {
                aContext.fail(submission.cause());
            }
        });
    }
@ Test public void testTiffImageLoad ( final TestContext aContext ) { Assume . assumeNotNull ( System . getProperty ( TestConstants . BUCKETEER_VERSION ) ) ; final String imagePath = URLEncoder . encode ( TEST_IMAGE_PATH , StandardCharsets . UTF_8 ) ; final String path = StringUtils . format ( PATH , myImageID , imagePath ) ; final WebClient webClient = WebClient . create ( myVertx ) ; final Async asyncTask = aContext . async ( ) ; webClient . get ( myPort , Constants . UNSPECIFIED_HOST , path ) . send ( submission -> { if ( submission . succeeded ( ) ) { final HttpResponse < Buffer > response = submission . result ( ) ; final JsonObject body = response . bodyAsJsonObject ( ) ; aContext . assertEquals ( HTTP . CREATED , response . statusCode ( ) ) ; aContext . assertEquals ( TEST_IMAGE_PATH , body . getString ( FILE_PATH ) ) ; aContext . assertEquals ( myImageID , body . getString ( IMAGE_ID ) ) ; TestUtils . complete ( asyncTask ) ; } else { aContext . fail ( submission . cause ( ) ) ; } } ) ; }
Tests to make sure that an image can be converted and uploaded as expected.
Tests to make sure that an image can be converted and uploaded as expected .