Find assertions in run methods

Proprietary

Marks JUnit 3, 4 and 5, AssertJ and Fest assertion and fail calls made inside the body of a no-argument run() method declared in a Runnable (which includes Thread subclasses), also when the call sits in a lambda or anonymous class within that body. Such an assertion throws AssertionError on whichever thread executes run(), and when that is not the test thread the test does not fail. Run the assertion on the test thread, or hand its failure over to it. A Runnable written as a lambda is not marked, because it has no run() declaration, and neither are the assert keyword, calls qualified with a subclass of an assertion class, or calls whose type is unknown.

io.moderne.staticanalysis.FindAssertionInRunMethod
mod run . --recipe=io.moderne.staticanalysis.FindAssertionInRunMethod

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.