<Stove4K> 0.3.3 is released! It has now cool testi...
# feed
o
Stove4K 0.3.3 is released! It has now cool testing DSL! For those who don’t know, Stove is a framework for e2e/integration testing for your Kotlin backend APIs that use Spring-Boot or Ktor. If you’re using
testcontainers
in your project you can easily switch to Stove for humanized way of writing tests alongside having the physical deps of your API. Here is how an e2e test looks like with new DSL:
Copy code
TestSystem.validate {
    wiremock {
        mockGet("/example-url", responseBody = None, statusCode = 200)
    }
    
    http {
        get<String>("/hello/index") { actual ->
            actual shouldContain "Hi from Stove framework"
        }
    }

    couchbase {
        shouldQuery<Any>("SELECT * FROM system:keyspaces") { actual ->
            actual shouldBe "keyspaces from your db"
        }
    }

    kafka {
        shouldBePublishedOnCondition<ExampleMessage> { actual ->
            actual.aggregateId == 123
        }
        shouldBeConsumedOnCondition<ExampleMessage> { actual ->
            actual.aggregateId == 123
        }
    }

    couchbase {
        save(collection = "Backlogs", id = "id-of-backlog", instance = Backlog("id-of-backlog"))
    }

    http {
        postAndExpectBodilessResponse("/backlog/reserve") { actual ->
            actual.status shouldBe 200
        }
    }

    kafka {
        shouldBeConsumedOnCondition<ProductCreated> { actual ->
            actual.aggregateId == expectedId
        }
    }
}
😍 1
d
Neat! Have you looked into using the #couchbase Kotlin SDK instead of the Java SDK?
o
Thanks! Yes, I was thinking of switching the library