Skip to content

Writing Tests

Here is an example test that validates http://localhost:$port/hello/index returns the expected text

class ExampleTest: FunSpec({

    test("should return hi"){
        TestSystem.validate {
            http {
                get<String>("/hello/index") { actual -> 
                    actual shouldContain "Hi from Stove framework" 
                }
            }
})
class ExampleTest {

    @Test
    fun `should return hi`() {
        TestSystem.validate {
            http {
                get<String>("/hello/index") { actual -> 
                    actual shouldContain "Hi from Stove framework" 
                }
            }
    }
})

That's it! You have up-and-running API, can be tested with Stove.