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

Warning with refEq #328

Closed
pablisco opened this issue Feb 26, 2019 · 1 comment
Closed

Warning with refEq #328

pablisco opened this issue Feb 26, 2019 · 1 comment

Comments

@pablisco
Copy link
Contributor

We are testing something that uses OkHttp interceptors and came across an issue that we are not sure how to fix. We have this:

verify(chain).proceed(refEq(expectedRequest))

To make sure the Chain is called with the right request. However, this gives us a Type Mismatch warning because It expects a Request and not Request? as refEq returns.

The only thing that we have tried to do is to add !! at the end to remove the warning but that has woese consequences as it makes the tests fail with a KotlinNullPointerException. Which is understandable since Mockito returns null in their implementation.

Would it be as simple as using ?: createInstance() as it is done on other matchers?

@nhaarman
Copy link
Collaborator

Fixed in #329

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

2 participants