{"action":"created","issue":{"url":"https://api.github.com/repos/nhaarman/mockito-kotlin/issues/307","repository_url":"https://api.github.com/repos/nhaarman/mockito-kotlin","labels_url":"https://api.github.com/repos/nhaarman/mockito-kotlin/issues/307/labels{/name}","comments_url":"https://api.github.com/repos/nhaarman/mockito-kotlin/issues/307/comments","events_url":"https://api.github.com/repos/nhaarman/mockito-kotlin/issues/307/events","html_url":"https://github.com/nhaarman/mockito-kotlin/issues/307","id":377011388,"node_id":"MDU6SXNzdWUzNzcwMTEzODg=","number":307,"title":"IncompatibleClassChangeError when using argThat","user":{"login":"Octogonapus","id":4064722,"node_id":"MDQ6VXNlcjQwNjQ3MjI=","avatar_url":"https://avatars0.githubusercontent.com/u/4064722?v=4","gravatar_id":"","url":"https://api.github.com/users/Octogonapus","html_url":"https://github.com/Octogonapus","followers_url":"https://api.github.com/users/Octogonapus/followers","following_url":"https://api.github.com/users/Octogonapus/following{/other_user}","gists_url":"https://api.github.com/users/Octogonapus/gists{/gist_id}","starred_url":"https://api.github.com/users/Octogonapus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Octogonapus/subscriptions","organizations_url":"https://api.github.com/users/Octogonapus/orgs","repos_url":"https://api.github.com/users/Octogonapus/repos","events_url":"https://api.github.com/users/Octogonapus/events{/privacy}","received_events_url":"https://api.github.com/users/Octogonapus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-03T01:32:11Z","updated_at":"2018-11-28T11:02:29Z","closed_at":null,"author_association":"NONE","body":"I get an `IncompatibleClassChangeError` with any use of the `argThat` matcher. Full stacktrace: https://pastebin.com/4hr67L0r. I am using version `2.0.0`.\r\n\r\nHere is a simple example I replicated the problem with:\r\n```kotlin\r\ninterface Foo {\r\n    fun doIt(arg: Int): Int\r\n}\r\n\r\nclass TestClass {\r\n    @Test\r\n    fun testIt() {\r\n        mock<Foo> {\r\n            on { doIt(argThat { true }) } doReturn 0\r\n        }\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/nhaarman/mockito-kotlin/issues/comments/442407687","html_url":"https://github.com/nhaarman/mockito-kotlin/issues/307#issuecomment-442407687","issue_url":"https://api.github.com/repos/nhaarman/mockito-kotlin/issues/307","id":442407687,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjQwNzY4Nw==","user":{"login":"bohsen","id":355452,"node_id":"MDQ6VXNlcjM1NTQ1Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/355452?v=4","gravatar_id":"","url":"https://api.github.com/users/bohsen","html_url":"https://github.com/bohsen","followers_url":"https://api.github.com/users/bohsen/followers","following_url":"https://api.github.com/users/bohsen/following{/other_user}","gists_url":"https://api.github.com/users/bohsen/gists{/gist_id}","starred_url":"https://api.github.com/users/bohsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bohsen/subscriptions","organizations_url":"https://api.github.com/users/bohsen/orgs","repos_url":"https://api.github.com/users/bohsen/repos","events_url":"https://api.github.com/users/bohsen/events{/privacy}","received_events_url":"https://api.github.com/users/bohsen/received_events","type":"User","site_admin":false},"created_at":"2018-11-28T11:02:29Z","updated_at":"2018-11-28T11:02:29Z","author_association":"NONE","body":"@Octogonapus I get a NullPointerException with the provided example. This is caused by `Mockito.argThat` which Mockito-kotlin uses under the hood. If you check the javadoc on `Mockito.argThat` they recommend you to use `intThat` instead:\r\n\r\n```kotlin\r\nclass TestClass {\r\n    @Test\r\n    fun testIt() {\r\n        val mock = mock<Foo> {\r\n            on { doIt(intThat { equals(42) }) } doReturn 0\r\n        }\r\n\r\n        assertThat(mock.doIt(42), `is`(0))\r\n    }\r\n}\r\n```\r\n\r\nThis should pass."}}
{"actor":{"display_login":"bohsen"}}