question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IncompatibleClassChangeError when using argThat

See original GitHub issue

I get an IncompatibleClassChangeError with any use of the argThat matcher. Full stacktrace: https://pastebin.com/4hr67L0r. I am using version 2.0.0.

Here is a simple example I replicated the problem with:

interface Foo {
    fun doIt(arg: Int): Int
}

class TestClass {
    @Test
    fun testIt() {
        mock<Foo> {
            on { doIt(argThat { true }) } doReturn 0
        }
    }
}

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
kTTcommented, May 16, 2019

@Octogonapus @timbaer I had same issue with mockito-kotlin 2.1.0 and I fixed it by adding explicit dependency to mockito-core 2.23.0

0reactions
bes89commented, Dec 8, 2019

Adding explicit dependency to testImplementation("org.mockito:mockito-core:2.23.0") solve the issue for me, thanks @kevcodez

Read more comments on GitHub >

github_iconTop Results From Across the Web

IncompatibleClassChangeError when using argThat #307
I get an IncompatibleClassChangeError with any use of the argThat matcher. Full stacktrace: https://pastebin.com/4hr67L0r.
Read more >
Mockito argThat does not work when used to match an iterator ...
I've never used Mockito.argThat , partially because I never had the need in defining custom argument matcher. When I understand your use ......
Read more >
Binary compatibility report for Mockito: 1.10.19 vs 2.1.0
This class became interface. A client program may be interrupted by IncompatibleClassChangeError or InstantiationError exception dependent on ...
Read more >
java web开发问题集锦_johnny233的博客
what-causes-java-lang-incompatibleclasschangeerror ... argThat;//来自mockito-core.jar import static org.mockito.ArgumentMatchers.
Read more >
Diff - platform/frameworks/base - Google Git
If so, make sure they are using the correct transaction ids and arguments. ... getInputType(); + } catch (IncompatibleClassChangeError e) { + mEditor....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found