thanksforallthefish
07/24/2019, 9:11 AMorg.springframework.context.ApplicationEventPublisher
and I cannot unit test it. What I mean is, if I write a test like
class SomeTest(
private val applicationEventPublisher: ApplicationEventPublisher = mockk(relaxed = true),
private val myClass: MyClass(applicationEventPublisher)) : StringSpec() {...}
applicationEventPublisher
visible to the test is not the mocked one but the one instantiated from ProjectConfig
.
A workaround is to have
class SomeTest : StringSpec() {
private val applicationEventPublisher: ApplicationEventPublisher = mockk(relaxed = true),
private val myClass: MyClass(applicationEventPublisher)
...
}
so actually not a big dealthanksforallthefish
07/24/2019, 9:23 AMProjectConfig
is that every test will start a small spring context, making every test not requiring spring slower than they should be