Skip to main content

Interested in sponsoring the site? [find out more]

FAQ: Why are my JUnit 4 asserts showing as deprecated

1 minute read - Java For Testers Java JUnit

FAQ: Why are my JUnit 4 asserts showing as deprecated

Aug 30, 2013

“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

If you like this content then you might be interested in my Patreon Community. I create exclusive content multiple times a week. Gain access to Patreon only content and online training courses for as little as $1 per month. Learn more about the EvilTester Patreon Community.

<< How would you check that a www web site redirects to a mobile site?
10 Experiments to Improve Your Exploratory Testing Note Taking >>