Open aedenj opened 2 months ago
Consider this ignore solution. https://github.com/Kotlin/kotlinx-kover/issues/431
Use https://java.testcontainers.org/features/creating_container/ for the e2e test.
Potetnially useful code, https://github.com/sureshg/testcontainers-kotlin/tree/master
This test wil increase coverage to 100%
@OptIn(DelicateCoroutinesApi::class)
@Test
fun `should start the service again`(): Unit =
runBlocking {
val job =
GlobalScope.launch {
main(emptyArray<String>())
}
Thread.sleep(3000)
val response = HttpClient().get("http://localhost:8080/")
job.cancel()
assertThat(response.bodyAsText()).isEqualTo("Hello, world!")
}
However its formulation is a little problematic. e.g. optin requirement
Need to cover,