rcd27
12/30/2022, 3:16 PMktor
with embeddedServer
using mockk
library. And we are facing some problems with mocking objects. What is the best way to test ktor
application? Assuming we need to mock some stuff that goes to third-party services? Any tough samples? Thanks.CLOVIS
12/30/2022, 3:23 PMCLOVIS
12/30/2022, 3:23 PMrcd27
12/30/2022, 3:28 PMrcd27
12/30/2022, 3:28 PMtestApplication
with createClient
DSLs.Roman Pavlyuk
12/31/2022, 5:36 PMtestApplication {
//mock top level getStuff() func
mockkStatic("my.package.name.ClassKt")
every { getStuff() } returns listOf(Stuff(), Stuff())
// mock class
val repository = mockk<MyRepository>()
val target = MyService(repository)
every { repository.save(any()) } just Runs
}