Skip to content

Commit

Permalink
Add the metadata key to RemovedMetadata event id, eg. `RemovedMetadat…
Browse files Browse the repository at this point in the history
…a.suppressions`
  • Loading branch information
rchache committed Aug 22, 2023
1 parent a77dc4e commit c84a132
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public final class RemovedMetadata extends AbstractDiffEvaluator {
public List<ValidationEvent> evaluate(Differences differences) {
return differences.removedMetadata()
.map(metadata -> ValidationEvent.builder()
.id(getEventId())
.id(getEventId() + "." + metadata.getLeft())
.severity(Severity.DANGER)
.sourceLocation(metadata.getRight().getSourceLocation())
.message(String.format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ public void detectsRemovedMetadata() {
Model modelB = Model.assembler().assemble().unwrap();
List<ValidationEvent> events = ModelDiff.compare(modelA, modelB);

assertThat(TestHelper.findEvents(events, "RemovedMetadata").size(), equalTo(1));
assertThat(TestHelper.findEvents(events, "RemovedMetadata.foo").size(), equalTo(1));
}
}

0 comments on commit c84a132

Please sign in to comment.