use of com.tngtech.archunit.core.domain.properties.HasName in project github-api by hub4j.
the class ArchTests method testRequireUseOfAssertThat.
@Test
public void testRequireUseOfAssertThat() {
final String reason = "This project uses `assertThat(...)` or `assertThrows(...)` instead of other `assert*()` methods.";
final DescribedPredicate<HasName> assertMethodOtherThanAssertThat = nameContaining("assert").and(DescribedPredicate.not(name("assertThat")).and(DescribedPredicate.not(name("assertThrows"))));
final ArchRule onlyAssertThatRule = classes().should(not(callMethodWhere(target(assertMethodOtherThanAssertThat)))).because(reason);
onlyAssertThatRule.check(testClassFiles);
}