Common Java 8 Test Utilities
// This package provides some common AssertJ assertions and other test utilities.
import static com.github.protobufel.test.common.misc.CommonAssertions.assertThatType;
import com.github.protobufel.test.common.misc.CommonJUnitSoftAssertions;
class MyTest {
//...
@Test
public void testUtilityClass() {
assertThatType(MyUtilityClass.class).isUtilityClass();
}
@Test
public void testSomethingElse() {
assertThatType(MyNonUtilityClass.class).isNotUtilityClass();
}
// or use soft assertions:
@Rule
public final CommonJunitSoftAssertions softly = new CommonJunitSoftAssertions();
@Test
public void testUtilityClassSoftly() {
softly.assertThatType(MyUtilityClass.class).isUtilityClass();
softly.assertThat(true).isTrue();
}
//...
}
For more see the JavaDoc Documentation.
Happy coding,
David Tesler