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

"But invoked here" should list the invocation parameters #2058

Closed
kriegfrj opened this issue Oct 1, 2020 · 0 comments
Closed

"But invoked here" should list the invocation parameters #2058

kriegfrj opened this issue Oct 1, 2020 · 0 comments

Comments

@kriegfrj
Copy link
Contributor

kriegfrj commented Oct 1, 2020

Thanks to Mockito, I just had an assertion failure that I just had a failure thanks to Mockito told me of an issue in my code that I need to fix. The error message looked like this:

cLogger.saveError("Error", <any string>);
Never wanted here:
-> at au.org.greekwelfaresa.idempiere.bpmodels.test.MBPartnerLocationTest.lambda$1(MBPartnerLocationTest.java:118)
But invoked here:
-> at org.compiere.model.PO.save(PO.java:2155)
-> at org.compiere.model.PO.save(PO.java:2155)

It occurred to me that it might be useful debugging to include not only the place where the invocation happened, but the arguments that were provided for each invocation. Because of the anyString() matcher, it is not immediately obvious what they are - if you're using exact match semantics, then you can infer the parameters from the first line, but that's not possible when you're using a matcher.

This feature could be added on all failure messages, or else only on failure messages when matchers are being used (as it is redundant when you're using exact match).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants