use of com.tngtech.archunit.lang.syntax.elements.GivenCodeUnitsTest.A in project ArchUnit by TNG.
the class CodeUnitsShouldTest method complex_code_unit_syntax.
@Test
public void complex_code_unit_syntax() {
EvaluationResult result = codeUnits().that(doNotHaveParametersOfType(List.class)).should().beAnnotatedWith(A.class).andShould().beProtected().orShould().haveRawReturnType(String.class).evaluate(importClasses(ClassWithVariousMembers.class));
assertViolation(result);
String failure = getOnlyElement(result.getFailureReport().getDetails());
assertThat(failure).matches(String.format(".*Constructor .*%s.* does not have modifier PROTECTED.*", quote(CONSTRUCTOR_ONE_ARG))).contains("and Constructor").matches(String.format(".*Constructor .*%s.* is not annotated with @A.*", quote(CONSTRUCTOR_ONE_ARG))).matches(String.format(".*Constructor .*%s.* does not have raw return type %s.*", quote(CONSTRUCTOR_ONE_ARG), String.class.getName()));
}
Aggregations