Skip to content

Commit

Permalink
fix java.lang.reflect.InaccessibleObjectException
Browse files Browse the repository at this point in the history
caused by Mockito

ref: https://stackoverflow.com/questions/68113065/mockito-inaccessible-object-exception-while-creating-a-mock-object

To quote:
"This can happen if Mockito requires reflective access to non-public parts in a Java module.
you can get around this by explicitly allowing access via --add-opens in your java call"
  • Loading branch information
kartva committed Nov 29, 2023
1 parent e6f19fd commit be533a3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ compileJava {
}

test {
jvmArgs '--add-opens=java.base/java.util.concurrent=ALL-UNNAMED'

testLogging {
exceptionFormat "full"
events "skipped", "passed", "failed", "started"
Expand Down

0 comments on commit be533a3

Please sign in to comment.