Skip to main content

Aug 30, 2013 - 1 minute read - Java For Testers Java JUnit

FAQ: Why are my JUnit 4 asserts showing as deprecated

“Why are my Junit 4 asserts deprecated?”

JUnit has a tendency to move code around, but it deprecates the old code, and there is usually a comment in the JUnit code somewhere explaining what to use instead.

But a common question on the Start Selenium WebDriver course relates to “Why are my asserts deprecated” and its usually because JUnit codebase has changed.

These changes are usually for the better, so keeping our code up to date and changing the import statements is a small price to pay.

Short Answer? Use the import from org.junit.Assert


You will need a Github account to comment. Or you can contact me with your comment.

I reserve the right to delete spam comments e.g. if your comment adds no value and its purpose is simply to create a backlink to another site offering training, or courses, etc.