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

Field with generics is not injected using @InjectMocks #3279

Open
3 of 5 tasks
bilak opened this issue Feb 22, 2024 · 1 comment
Open
3 of 5 tasks

Field with generics is not injected using @InjectMocks #3279

bilak opened this issue Feb 22, 2024 · 1 comment

Comments

@bilak
Copy link

bilak commented Feb 22, 2024

  • The mockito message in the stacktrace have useful information, but it didn't help
  • The problematic code (if that's possible) is copied here;
    Note that some configuration are impossible to mock via Mockito
  • Provide versions (mockito / jdk / os / any other relevant information)
  • Provide a Short, Self Contained, Correct (Compilable), Example of the issue
    (same as any question on stackoverflow.com)
  • Read the contributing guide

Hey, while upgrading to spring-boot 3.2.2 I've noticed strange behaviour on generic classes. I've already updated the mockito to 5.10.0 however it doesn't seems to solve the issue. We have a high abstraction in the project and seems like with recent changes some mocks are not injected anymore.

here is a sample test class which reproduces the issue.

@bilak
Copy link
Author

bilak commented Feb 22, 2024

#3221 #3019 are related

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

1 participant