Dear All,
Running my tests yields the warning below.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.mockito.internal.util.reflection.ReflectionMemberAccessor (file:/home/chrisd/.m2/repository/org/mockito/mockito-core/4.7.0/mockito-core-4.7.0.jar) to field
java.lang.Thread.nameWARNING: Please consider reporting this to the maintainers of org.mockito.internal.util.reflection.ReflectionMemberAccessor
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
I tried to debug/simplify and found out that merely doing thread = spy(new Thread()) in a test leads to this warning being displayed. (In the actual test I am trying to spy on a class that inhertis from Thread, but the result is the same). Should something be done about this warning or is it harmless? It sounds bad that "All illegal access operations will be denied in a future release".....
One option would be to try to make the Thread a member of the relevant class instead of inheriting from it.
Kind Regards,
Chris