guhilling / cdi-test

JUnit extension for easy and efficient testing of CDI components
http://guhilling.github.io/cdi-test/
Apache License 2.0
25 stars 4 forks source link

Support for MockK #463

Open kfud opened 4 weeks ago

kfud commented 4 weeks ago

I'd like to use Kotlin and the MockK library to generate mocks for cdi-test, but cdi-test doesn't seem to pick up de annotated mocks. I'd like some hints as to how I can extend cdi-test to support MockK mocks. Mockito seeems to work as described, but I like the Kotlin DSL of MockK better and would like to use that instead. Any hints would be appreciated, I'll start taking a look myself though.

kfud commented 4 weeks ago

Was taking a quick look... I can seem to find any mock life-cycle listeners in the framework unfortunately... Might be a challenge to get this to work.

guhilling commented 4 weeks ago

I‘ll take a look at the issue later this weekend, OK?Kind regards,GunnarAm 06.06.2024 um 15:53 schrieb Kris Fudalewski @.***>: Was taking a quick look... I can seem to find any mock life-cycle listeners in the framework unfortunately... Might be a challenge to get this to work.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

guhilling commented 3 weeks ago

Hi @kfud ! It's actually in de.hilling.junit.cdi.scope.InvocationTargetManager that implements org.mockito.listeners.MockCreationListener I'll think about a solution how this could be adopted to a different mocking framework. Or would you have an idea? Anything similar to org.mockito.listeners.MockCreationListener in MockK?