jSparrow Markers

jSparrow 4.0.0 & jSparrow Maven Plugin 3.7.0
We are excited to announce the midsummer release comes with a major update to jSparrow 4.0.0. The key new feature in this release is the jSparrow Marker. Additionally, 3 more rules for refactoring JUnit tests are added to the jSparrow rule set, thus increasing the total number of refactoring rules to 98.

New key feature to your toolbox:

jSparrow Markers

For the first time, we introduce jSparrow Markers to help developers mitigate issues and code smells in real time, while writing new code.

The markers for the first 10 jSparrow Rules are available to everyone. More markers for more rules are about to come.


Use Dedicated Assertions

Replaces boolean assertions (e.g., assertTrue and assertFalse) with the corresponding dedicated assertions when testing for equality or null values. Thus, improving the assertion failure messages and the readability of the test code. It supports both, JUnit 4 and JUnit Jupiter assertions.

The following assertion:

assertTrue(expected.equals(actual));

is transformed to:

assertEquals(expected, actual);

Replace JUnit Assumptions with Hamcrest JUnit

This rule replaces the JUnit 4 assumptions assumeThat, assumeNoException, and assumeNotNull by the equivalent invocations of Hamcrest JUnit assumption MatcherAssume.assumeThat.

Since JUnit 5 contains no equivalent assumption methods, this rule eliminates an obstacle when migrating to JUnit 5.

The following test:

import static org.hamcrest.Matchers.equalToIgnoringCase;
import static org.junit.Assume.assumeThat;
//..
 @Test
 public void test() {
   //...
   assumeThat(value, equalToIgnoringCase("value"));
 }

is transformed to:

import static org.hamcrest.Matchers.equalToIgnoringCase;
import static org.hamcrest.junit.MatcherAssume.assumeThat;
//..
 @Test
 public void test() {
   //...
   assumeThat(value, equalToIgnoringCase("value"));
 }

Replace JUnit 4 Category with JUnit Jupiter Tag

This rule replaces JUnit 4 @Category annotations with one or more JUnit Jupiter @Tag annotations. This replacement is a further step toward transitioning to JUnit Jupiter.

The following test:

@Category({ FirstCategory.class, SecondCategory.class })
@Test
public void test() {
	// ...
}

is transformed to:

@Tag("io.jsparrow.examples.FirstCategory")
@Tag("io.jsparrow.examples.SecondCategory")
@Test
public void test() {
	// ...
}

The new rules bring jSparrow to a total of 98 automatic refactoring rules.

Find out more information in the Release Notes for jSparrow Eclipse and jSparrow Maven!

The function of a good software is to make the complex appear to be simple.” ― Grady Booch

Promotion pop-up

jSparrow 22% off promotion image