All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.groovy.AppTest.groovy Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
import com.jetdrone.vertx.yoke.GYoke
import com.jetdrone.vertx.yoke.test.GYokeTester
import org.junit.Test
import org.vertx.groovy.core.Vertx
import org.vertx.groovy.platform.Container
import org.vertx.testtools.TestVerticle

import static org.vertx.testtools.VertxAssert.*

public class AppTest extends TestVerticle {

    @Test
    public void testApp() {
        final GYoke yoke = new GYoke(new Vertx(vertx), new Container(container))
        yoke.use() { request, next ->
            request.response.end("OK")
        }

        final GYokeTester yokeAssert = new GYokeTester(yoke)

        yokeAssert.request("GET", "/") { response ->
            assertEquals("OK", response.body.toString())
            testComplete()
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy