src/test/java/edu/ucla/library/bucketeer/verticles/SlackMessageVerticleTest.java
@Test
    public final void testSlackSendMessage(final TestContext aContext) {
        final String textMessage = LOGGER.getMessage(MessageCodes.BUCKETEER_116);
        final String errorMessage = LOGGER.getMessage(MessageCodes.BUCKETEER_110, textMessage);
        final JsonObject message = new JsonObject();
        final Async asyncTask = aContext.async();

        message.put(Constants.SLACK_MESSAGE_TEXT, errorMessage);
        message.put(Config.SLACK_CHANNEL_ID, mySlackErrorChannelID);

        myVertx.eventBus().request(VERTICLE_NAME, message, send -> {
            if (send.failed()) {
                final Throwable details = send.cause();

                if (details != null) {
                    LOGGER.error(details, details.getMessage());
                }

                aContext.fail(send.cause());
            } else {
                TestUtils.complete(asyncTask);
            }
        });
    }
/**
     * Tests being able to send a Slack text message.
     *
     * @param aContext A test context
     */
Tests being able to send a Slack text message.
@param aContext A test context
Tests being able to send a Slack text message . @param aContext A test context
@Test
    public final void testSlackSendMessage(final TestContext aContext) {
        final String textMessage = LOGGER.getMessage(MessageCodes.BUCKETEER_116);
        final String errorMessage = LOGGER.getMessage(MessageCodes.BUCKETEER_110, textMessage);
        final JsonObject message = new JsonObject();
        final Async asyncTask = aContext.async();
        message.put(Constants.SLACK_MESSAGE_TEXT, errorMessage);
        message.put(Config.SLACK_CHANNEL_ID, mySlackErrorChannelID);
        myVertx.eventBus().request(VERTICLE_NAME, message, send -> {
            if (send.failed()) {
                final Throwable details = send.cause();
                if (details != null) {
                    LOGGER.error(details, details.getMessage());
                }
                aContext.fail(send.cause());
            } else {
                TestUtils.complete(asyncTask);
            }
        });
    }
@ Test public final void testSlackSendMessage ( final TestContext aContext ) { final String textMessage = LOGGER . getMessage ( MessageCodes . BUCKETEER_116 ) ; final String errorMessage = LOGGER . getMessage ( MessageCodes . BUCKETEER_110 , textMessage ) ; final JsonObject message = new JsonObject ( ) ; final Async asyncTask = aContext . async ( ) ; message . put ( Constants . SLACK_MESSAGE_TEXT , errorMessage ) ; message . put ( Config . SLACK_CHANNEL_ID , mySlackErrorChannelID ) ; myVertx . eventBus ( ) . request ( VERTICLE_NAME , message , send -> { if ( send . failed ( ) ) { final Throwable details = send . cause ( ) ; if ( details != null ) { LOGGER . error ( details , details . getMessage ( ) ) ; } aContext . fail ( send . cause ( ) ) ; } else { TestUtils . complete ( asyncTask ) ; } } ) ; }
Tests being able to send a Slack text message.
Tests being able to send a Slack text message .