@@ -0,0 +1,2370 @@
+package com.gofish.sentiment.newscrawler;%0A%0Aimport io.vertx.core.DeploymentOptions;%0Aimport io.vertx.core.Vertx;%0Aimport io.vertx.core.json.JsonObject;%0Aimport io.vertx.ext.unit.TestContext;%0Aimport io.vertx.ext.unit.junit.RunTestOnContext;%0Aimport io.vertx.ext.unit.junit.VertxUnitRunner;%0Aimport org.junit.Before;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0A%0Aimport java.util.concurrent.atomic.AtomicReference;%0A%0A/**%0A * @author Luke Herron%0A */%0A@RunWith(VertxUnitRunner.class)%0Apublic class NewsCrawlerVerticleTest %7B%0A%0A    @Rule%0A    public final RunTestOnContext vertxRule = new RunTestOnContext();%0A%0A    private Vertx vertx;%0A    private DeploymentOptions deploymentOptions;%0A%0A    @Before%0A    public void setUp() %7B%0A        vertx = vertxRule.vertx();%0A%0A        JsonObject config = new JsonObject().put(%22api%22, new JsonObject()%0A                .put(%22base.url%22, %22localhost%22)%0A                .put(%22url.path%22, %22/bing/v5.0/news/search%22)%0A                .put(%22port%22, 80)%0A                .put(%22result.count%22, 100)%0A                .put(%22freshness%22, %22Day%22));%0A%0A        deploymentOptions = new DeploymentOptions().setConfig(config);%0A    %7D%0A%0A    @Test%0A    public void testStartingVerticle(TestContext context) %7B%0A        vertx.deployVerticle(NewsCrawlerVerticle.class.getName(), deploymentOptions, context.asyncAssertSuccess(context::assertNotNull));%0A    %7D%0A%0A    @Test%0A    public void testStoppingVerticle(TestContext context) %7B%0A        vertx.deployVerticle(NewsCrawlerVerticle.class.getName(), deploymentOptions, context.asyncAssertSuccess(result -%3E %7B%0A            vertx.close(context.asyncAssertSuccess());%0A        %7D));%0A    %7D%0A%0A    @Test%0A    public void testNewsCrawlerServicePublishedStatus(TestContext context) %7B%0A        final AtomicReference%3CString%3E serviceDiscoveryStatus = new AtomicReference%3C%3E();%0A%0A        vertx.eventBus().%3CJsonObject%3Econsumer(%22vertx.discovery.announce%22, messageHandler -%3E %7B%0A            final JsonObject announce = messageHandler.body();%0A            serviceDiscoveryStatus.set(announce.getString(%22status%22));%0A        %7D);%0A%0A        vertx.deployVerticle(NewsCrawlerVerticle.class.getName(), deploymentOptions, context.asyncAssertSuccess(result -%3E %7B%0A            context.assertEquals(serviceDiscoveryStatus.get(), %22UP%22, %22Service Discovery Status returned '%22 +%0A                    serviceDiscoveryStatus + %22'. Expected 'UP'%22);%0A        %7D));%0A    %7D%0A%7D%0A

Add unit tests for NewsCrawlerVerticle