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

AssertionFailureIgnored recommends to use a method that does not exist #1059

Closed
iemejia opened this issue Jun 21, 2018 · 5 comments
Closed

Comments

@iemejia
Copy link

iemejia commented Jun 21, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Error Prone are you using?

latest

Does this issue reproduce with the latest release?

yes

What did you do?

A warning is reported that directs me to this documentation
http://errorprone.info/bugpattern/AssertionFailureIgnored

What did you expect to see?

A way to solve the issue out of the box

What did you see instead?

The documentation suggests to use Assert.assertThrows that is a method that does not exist in Junit 4.

@cushon
Copy link
Collaborator

cushon commented Jun 21, 2018

assertThrows is available in JUnit 5, and will be included in 4.13 once it's released.

Until then, you can disable the check by passing -Xep:AssertionFailureIgnored:OFF.

@iemejia
Copy link
Author

iemejia commented Jun 21, 2018

Mmm I see, but well 97% of the Java projects still use Junit 4, and given that the last release of Junit 4 was in 2014 and that there is not even an ETA for the next release probably is a better idea to clarify this in the docs don't you think?, and even better to propose a backwards compatible recommendation.

@cushon
Copy link
Collaborator

cushon commented Jan 8, 2021

JUnit 4.13 has been released

@cushon cushon closed this as completed Jan 8, 2021
@cushon
Copy link
Collaborator

cushon commented Jan 8, 2021

JUnit 4.13 has been released!

@iemejia
Copy link
Author

iemejia commented Jan 8, 2021

Thanks for the info @cushon

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