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