AnnotationTrait implements Trait { @Override public final SourceLocation getSourceLocation() { return node.getSourceLocation(); } AnnotationTrait(ShapeId id, ObjectNode node); @Override final ShapeId toShapeId(); @Override final Node toNode(); @Override final SourceLocation getSourceLocation(); @Override int hashCode(); @Override boolean equals(Object other);  }
@Test public void loadsAnnotationTraitObjects() { SourceLocation sourceLocation = new SourceLocation("/foo"); ObjectNode objectNode = new ObjectNode(Collections.emptyMap(), sourceLocation); SensitiveTrait trait = new SensitiveTrait.Provider().createTrait(ShapeId.from("foo#bar"), objectNode); assertThat(trait.getSourceLocation(), equalTo(sourceLocation)); }