Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bind mocks by constructor #104

Closed
kkurczewski opened this issue Mar 24, 2023 · 4 comments
Closed

Bind mocks by constructor #104

kkurczewski opened this issue Mar 24, 2023 · 4 comments

Comments

@kkurczewski
Copy link

Hi,

currently this project allows to scan fields with lateinit var for @MockkBean and @SpykBean annotations, would you be interested in PR that extends scanning to constructor parameters?

I did a some prototyping and besides changes in DefinitionsParser this feature requires Junit 5ParameterResolver to be implemented as well - not sure if you would want it in the same artifact or as a separate one.

So, what do you say?

@csikb
Copy link

csikb commented Oct 5, 2023

+1

@jnizet
Copy link
Member

jnizet commented Jan 19, 2024

Sorry for the very very late reply.
I plan to stick to what the Spring Boot support does for Mockito. Diverging too much from that would potentially introduce new bugs that I don't feel like fixing, and make the job of mirroring the changes that Spring Boot introduces harder.

@jnizet jnizet closed this as completed Jan 19, 2024
@olaisolheim
Copy link

Oh noes, we've (organisation with 100 devs) been waiting for constructor support, as it lends itself to more idiomatic Kotlin.

Please reconsider! 🤞

@jnizet
Copy link
Member

jnizet commented Jan 19, 2024

TBH, I don't use Kotlin very much anymore these days, and I maintain this for free, and on my free time. If you or your company would like to fork this library and take over its maintenance in the future, I'd be happy to archive this repo and make it point to your fork.

I see that the change is not huge, so I might consider integrating it, but it would be nice if you could step up to fix potential bugs, and help me at least concerning this part, in the future, so that it doesn't become a hassle for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants