All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.java.rules.squid.S2186.html Maven / Gradle / Ivy

There is a newer version: 8.6.0.37351
Show newest version

JUnit assertions should not be made from the run method of a Runnable, because failed assertions result in AssertionErrors being thrown. If the error is thrown from a thread other than the one that ran the test, the thread will exit but the test won't fail.

Noncompliant Code Example

public void run() {
  // ...
  Assert.assertEquals(expected, actual);  // Noncompliant
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy