Before we continue to add our cats to the database, let's first write some tests to make sure that everything works correctly so far.
For that, we'll use the TestNG test framework. You can also use JUnit or VertxUnit for the same purpose.
Start by adding the following line to the dependencies part of your build.gradle:
testCompile group: 'org.testng', name: 'testng', version: '6.11'
Now we'll create our first test. It should be located under /src/test/kotlin/<your_package>.
The basic structure of all the integration tests looks something like this:
class ServerVerticleTest {
// Usually one instance of VertX is more than enough
val vertx = Vertx.vertx()
@BeforeClass
fun setUp() {
// You want to start your server once
startServer()
}
@AfterClass
fun tearDown() {
// And you want to...