Simplify AssertJ Assertions with jSparrow

We are happy to announce that jSparrow January release introduces a new rule and adds 21 jSparrow markers for existing rules.

Use Dedicated AssertJ Assertions

AssertJ contains a rich API for writing specific assertions about different types of objects. This rule encourages developers to make use of the dedicated assertions provided by AssertJ. Thus, simplifying the test code and improving the assertion failure messages.

Pre

assertThat(expectedString.equals(“value”)).isTrue();

assertThat(expectedList.contains(“value”)).isTrue();

assertThat(expectedMap.containsKey(“key”)).isTrue();

assertThat(expectedFile.isFile()).isTrue();

assertThat(expectedPath.isAbsolute()).isTrue();

Post

assertThat(expectedString).isEqualTo(“value”);

assertThat(expectedList).contains(“value”);

assertThat(expectedMap).containsKey(“key”);

assertThat(expectedFile).isFile();

assertThat(expectedPath).isAbsolute();

More jSparrow Markers

Twenty-one new markers are added to jSparrow. Thus, bringing the total number of jSparrow markers to 41. The preference page is redesigned to group markers by their tags:

jSparrow provides now a total of 108 automatic refactoring rules. Find out more information in the Release Notes for jSparrow Eclipse and jSparrow Maven!

“A clever person solves a problem. A wise person avoids it.” ― Albert Einstein

Happy Coding!

Leave a Reply

Your email address will not be published.