src/test/java/edu/ucla/library/bucketeer/handlers/GetJobStatusesHandlerTest.java
@Test
    public final void testGetJobStatusesHandler(final TestContext aContext) {
        final Async asyncTask = aContext.async();

        // Get the jobs map so we can put our test job in there
        myVertx.sharedData().<String, Job>getLocalAsyncMap(Constants.LAMBDA_JOBS, getMap -> {
            if (getMap.succeeded()) {
                try {
                    final JsonObject statuses = new JsonObject(StringUtils.read(JSON_STATUSES));
                    final JsonArray items = statuses.getJsonArray(Constants.JOBS);
                    final AsyncMap<String, Job> map = getMap.result();

                    map.put(JOB_NAME, getJob(items), new TestHandler(aContext, asyncTask, statuses));
                } catch (final IOException details) {
                    aContext.fail(details);
                }
            } else {
                aContext.fail(getMap.cause());
            }
        });
    }
/**
     * Tests getting job statuses.
     *
     * @param aContext A testing context
     */
Tests getting job statuses.
@param aContext A testing context
Tests getting job statuses . @param aContext A testing context
@Test
    public final void testGetJobStatusesHandler(final TestContext aContext) {
        final Async asyncTask = aContext.async();
        myVertx.sharedData().<String, Job>getLocalAsyncMap(Constants.LAMBDA_JOBS, getMap -> {
            if (getMap.succeeded()) {
                try {
                    final JsonObject statuses = new JsonObject(StringUtils.read(JSON_STATUSES));
                    final JsonArray items = statuses.getJsonArray(Constants.JOBS);
                    final AsyncMap<String, Job> map = getMap.result();
                    map.put(JOB_NAME, getJob(items), new TestHandler(aContext, asyncTask, statuses));
                } catch (final IOException details) {
                    aContext.fail(details);
                }
            } else {
                aContext.fail(getMap.cause());
            }
        });
    }
@ Test public final void testGetJobStatusesHandler ( final TestContext aContext ) { final Async asyncTask = aContext . async ( ) ; myVertx . sharedData ( ) . < String , Job > getLocalAsyncMap ( Constants . LAMBDA_JOBS , getMap -> { if ( getMap . succeeded ( ) ) { try { final JsonObject statuses = new JsonObject ( StringUtils . read ( JSON_STATUSES ) ) ; final JsonArray items = statuses . getJsonArray ( Constants . JOBS ) ; final AsyncMap < String , Job > map = getMap . result ( ) ; map . put ( JOB_NAME , getJob ( items ) , new TestHandler ( aContext , asyncTask , statuses ) ) ; } catch ( final IOException details ) { aContext . fail ( details ) ; } } else { aContext . fail ( getMap . cause ( ) ) ; } } ) ; }
Tests getting job statuses.
Tests getting job statuses .
// Get the jobs map so we can put our test job in there