use of com.tngtech.archunit.lang.conditions.FieldAccessCondition.FieldGetAccessCondition in project ArchUnit by TNG.
the class FieldAccessConditionTest method FieldGetAccessCondition_only_satisfied_on_get_field.
@Test
public void FieldGetAccessCondition_only_satisfied_on_get_field() {
JavaFieldAccess getAccess = accessFromCallerToTargetWithType(GET);
FieldGetAccessCondition getFieldCondition = new FieldGetAccessCondition(target(name(getAccess.getTarget().getName())));
assertSatisfiedWithMessage(getFieldCondition, getAccess, "gets");
JavaFieldAccess setAccess = accessFromCallerToTargetWithType(SET);
getFieldCondition = new FieldGetAccessCondition(target(name(setAccess.getTarget().getName())));
assertViolatedWithMessage(getFieldCondition, setAccess, "sets");
}
Aggregations