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

InvalidUseOfMatchersException on java 19 in presence of default arguments #488

Open
Krever opened this issue Feb 3, 2023 · 0 comments
Open

Comments

@Krever
Copy link
Contributor

Krever commented Feb 3, 2023

After upgrading to java 19 we started seeing InvalidUseOfMatchersException errors coming from mockito.

trait Foo {
  def bar(a: String, b: Int = 1): Int
}

object Test extends org.mockito.IdiomaticMockito {
  def main(args: Array[String]): Unit = {
    val x = mock[Foo]
    x.bar("a").returns(2)
  }
}

Above code works fine on java 17 but throws on java 19.

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