// Path: vertx-guice/src/test/java/com/intapp/vertx/guice/stubs/VerticleWithVertxDependency.java
// public class VerticleWithVertxDependency extends AbstractVerticle {
//     public static AtomicInteger instanceCount = new AtomicInteger();
// 
//     @Inject
//     public VerticleWithVertxDependency(Vertx vertxInstanceDependency) {
//         Preconditions.checkNotNull(vertxInstanceDependency);
//     }
// 
//     @Override
//     public void start() throws Exception {
//         instanceCount.incrementAndGet();
//     }
// 
//     @Override
//     public void stop() throws Exception {
//         instanceCount.decrementAndGet();
//     }
// }


import com.intapp.vertx.guice.stubs.VerticleWithVertxDependency;
import com.google.inject.Guice;
import com.google.inject.Injector;
import io.vertx.core.DeploymentOptions;
import io.vertx.rx.java.ObservableFuture;
import io.vertx.rx.java.RxHelper;
import io.vertx.test.core.VertxTestBase;
import org.junit.Before;
import org.junit.Test;
package com.intapp.vertx.guice;





/**
 * Implements tests to veriry logic of the {@see GuiceVertxDeploymentManager} class.
 */
public class GuiceVertxDeploymentManagerTest extends VertxTestBase {

    @Override
    @Before
    public void setUp() throws Exception {
        super.setUp();

        Injector injector = Guice.createInjector(new VertxModule(this.vertx));

        GuiceVerticleFactory guiceVerticleFactory = new GuiceVerticleFactory(injector);
        vertx.registerVerticleFactory(guiceVerticleFactory);

        VerticleWithVertxDependency.instanceCount.set(0);
    }

    /**
     * Verifies that verticle with dependency can be deployed successfully.
     * @throws Exception
     */
    @Test
    public void testDeployVerticle() throws Exception {
        // Act
        GuiceVertxDeploymentManager deploymentManager = new GuiceVertxDeploymentManager(this.vertx);
        deploymentManager.deployVerticle(VerticleWithVertxDependency.class);
// Path: vertx-guice/src/test/java/com/intapp/vertx/guice/stubs/VerticleWithVertxDependency.java
// public class VerticleWithVertxDependency extends AbstractVerticle {
//     public static AtomicInteger instanceCount = new AtomicInteger();
// 
//     @Inject
//     public VerticleWithVertxDependency(Vertx vertxInstanceDependency) {
//         Preconditions.checkNotNull(vertxInstanceDependency);
//     }
// 
//     @Override
//     public void start() throws Exception {
//         instanceCount.incrementAndGet();
//     }
// 
//     @Override
//     public void stop() throws Exception {
//         instanceCount.decrementAndGet();
//     }
// }


// Path: vertx-guice/src/test/java/com/intapp/vertx/guice/GuiceVertxDeploymentManagerTest.java
import com.intapp.vertx.guice.stubs.VerticleWithVertxDependency;
import com.google.inject.Guice;
import com.google.inject.Injector;
import io.vertx.core.DeploymentOptions;
import io.vertx.rx.java.ObservableFuture;
import io.vertx.rx.java.RxHelper;
import io.vertx.test.core.VertxTestBase;
import org.junit.Before;
import org.junit.Test;

package com.intapp.vertx.guice;





/**
 * Implements tests to veriry logic of the {@see GuiceVertxDeploymentManager} class.
 */
public class GuiceVertxDeploymentManagerTest extends VertxTestBase {

    @Override
    @Before
    public void setUp() throws Exception {
        super.setUp();

        Injector injector = Guice.createInjector(new VertxModule(this.vertx));

        GuiceVerticleFactory guiceVerticleFactory = new GuiceVerticleFactory(injector);
        vertx.registerVerticleFactory(guiceVerticleFactory);

        VerticleWithVertxDependency.instanceCount.set(0);
    }

    /**
     * Verifies that verticle with dependency can be deployed successfully.
     * @throws Exception
     */
    @Test
    public void testDeployVerticle() throws Exception {
        // Act
        GuiceVertxDeploymentManager deploymentManager = new GuiceVertxDeploymentManager(this.vertx);
        deploymentManager.deployVerticle(VerticleWithVertxDependency.class);
        waitUntil(() -> VerticleWithVertxDependency.instanceCount.get() == 1);