From 7c85990cac9dce060526865325afc06f38db59c7 Mon Sep 17 00:00:00 2001 From: Richard Chen Date: Mon, 21 Aug 2023 22:55:37 -0400 Subject: [PATCH] Add the metadata key to RemovedMetadata event id, eg. `RemovedMetadata.suppressions` --- .../software/amazon/smithy/diff/evaluators/RemovedMetadata.java | 2 +- .../amazon/smithy/diff/evaluators/RemovedMetadataTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/RemovedMetadata.java b/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/RemovedMetadata.java index 27a6e03c2d4..6bd365f14e1 100644 --- a/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/RemovedMetadata.java +++ b/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/RemovedMetadata.java @@ -30,7 +30,7 @@ public final class RemovedMetadata extends AbstractDiffEvaluator { public List 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( diff --git a/smithy-diff/src/test/java/software/amazon/smithy/diff/evaluators/RemovedMetadataTest.java b/smithy-diff/src/test/java/software/amazon/smithy/diff/evaluators/RemovedMetadataTest.java index 2ad1649bd58..c0c63be50a5 100644 --- a/smithy-diff/src/test/java/software/amazon/smithy/diff/evaluators/RemovedMetadataTest.java +++ b/smithy-diff/src/test/java/software/amazon/smithy/diff/evaluators/RemovedMetadataTest.java @@ -32,6 +32,6 @@ public void detectsRemovedMetadata() { Model modelB = Model.assembler().assemble().unwrap(); List events = ModelDiff.compare(modelA, modelB); - assertThat(TestHelper.findEvents(events, "RemovedMetadata").size(), equalTo(1)); + assertThat(TestHelper.findEvents(events, "RemovedMetadata.foo").size(), equalTo(1)); } }