TesterHQ - The Evil Tester Blog Aggregator

Aug 30, 2013 - 1 minute read - FAQ Java Selenium Simplified Blog

FAQ: Why are my JUnit asserts showing as deprecated

Original Blog Posting on [SeleniumSimplified.com]

I tend to use Hamcrest’s AssertThat now, but I still write Assert in some of my example code.

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