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

'Illegal reflective access operation has occurred' using WithObjectMocked #489

Open
matt-calderaz opened this issue Feb 10, 2023 · 0 comments

Comments

@matt-calderaz
Copy link

Hi folks,

I'm using:

  • openJDK 11
  • scala 2.13.10
  • mockito-scala-cats 1.17.12
  • scalaTestPlus 5.1.0

I've added src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker to enable the inline mock maker. After doing so I am able to write a unit test using the withObjectMocked block; however I also notice the following warnings:

WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.mockito.ReflectionUtils$ (file:/Users/mcalde28/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/mockito/mockito-scala_2.13/1.17.12/mockito-scala_2.13-1.17.12.jar) to method java.lang.Class.getDeclaredFields0(boolean) WARNING: Please consider reporting this to the maintainers of org.mockito.ReflectionUtils$ WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release
Any remedy for this?

Thanks!

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