Create a WithDsl for constructing/configuring the entire system
osoykan opened this issue · 2 comments
osoykan commented
MongoDB has this implementation; use the same approach in other places, too.
osoykan commented
Example usage:
TestSystem(baseUrl = "http://localhost:8001")
.with {
httpClient()
couchbase { CouchbaseSystemOptions("Stove") }
kafka()
wiremock {
WireMockSystemOptions(
port = 9099,
removeStubAfterRequestMatched = true,
afterRequest = { e, _, _ ->
logger.info(e.request.toString())
}
)
}
springBoot(
runner = { parameters ->
stove.spring.example.run(parameters) {
this.addTestSystemDependencies()
}
},
withParameters = listOf(
"server.port=8001",
"logging.level.root=info",
"logging.level.org.springframework.web=info",
"spring.profiles.active=default",
"kafka.heartbeatInSeconds=2",
"kafka.autoCreateTopics=true",
"kafka.offset=earliest",
"kafka.secureKafka=false"
)
)
}.run()