use of com.tngtech.archunit.core.domain.AccessTarget.CodeUnitCallTarget in project ArchUnit by TNG.
the class AccessTargetTest method single_throws_declaration_is_resolved.
@Test
public void single_throws_declaration_is_resolved() {
CodeUnitCallTarget target = getTarget("withASingleThrowsDeclaration");
assertDeclarations(target, FirstCheckedException.class);
}
use of com.tngtech.archunit.core.domain.AccessTarget.CodeUnitCallTarget in project ArchUnit by TNG.
the class AccessTargetTest method throws_declarations_on_non_unique_call_Targets_match_Reflection_API.
@Test
public void throws_declarations_on_non_unique_call_Targets_match_Reflection_API() {
CodeUnitCallTarget target = getTarget("diamondMethod");
assertDeclarations(target, FirstCheckedException.class, SecondCheckedException.class, ThirdCheckedException.class);
}
use of com.tngtech.archunit.core.domain.AccessTarget.CodeUnitCallTarget in project ArchUnit by TNG.
the class AccessTargetTest method no_throws_clause_is_resolved.
@Test
public void no_throws_clause_is_resolved() {
CodeUnitCallTarget target = getTarget("withoutThrowsDeclaration");
ThrowsClause<? extends CodeUnitCallTarget> throwsClause = target.getThrowsClause();
assertThatThrowsClause(throwsClause).as("throws clause").isEmpty();
assertThat(throwsClause.getTypes()).isEmpty();
assertThat(throwsClause.getOwner()).isEqualTo(target);
assertThatType(throwsClause.getDeclaringClass()).matches(Target.class);
}
use of com.tngtech.archunit.core.domain.AccessTarget.CodeUnitCallTarget in project ArchUnit by TNG.
the class AccessTargetTest method multiple_throws_declarations_are_resolved.
@Test
public void multiple_throws_declarations_are_resolved() {
CodeUnitCallTarget target = getTarget("withMultipleThrowsDeclarations");
assertDeclarations(target, FirstCheckedException.class, SecondCheckedException.class);
}
Aggregations