ValidationEvent implements Comparable<ValidationEvent>, ToNode, ToSmithyBuilder<ValidationEvent> { public static Builder builder() { return new Builder(); } private  ValidationEvent(Builder builder); static Builder builder(); static ValidationEvent fromSourceException(SourceException exception); static ValidationEvent fromSourceException(SourceException exception, String prefix); @Override int compareTo(ValidationEvent other); @Override Builder toBuilder(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override Node toNode(); static ValidationEvent fromNode(Node node); SourceLocation getSourceLocation(); String getMessage(); Severity getSeverity(); String getEventId(); String getId(); Optional<ShapeId> getShapeId(); Optional<String> getSuppressionReason();  }
@Test public void requiresMessage() { Assertions.assertThrows(IllegalStateException.class, () -> { ValidationEvent.builder() .severity(Severity.ERROR) .id("foo") .build(); }); }
@Test public void requiresSeverity() { Assertions.assertThrows(IllegalStateException.class, () -> { ValidationEvent.builder() .message("test") .id("foo") .build(); }); }
@Test public void requiresId() { Assertions.assertThrows(IllegalStateException.class, () -> { ValidationEvent.builder() .severity(Severity.ERROR) .message("test") .build(); }); }
@Test public void suppressionIsOnlyValidWithSuppress() { Assertions.assertThrows(IllegalStateException.class, () -> { ValidationEvent.builder() .severity(Severity.ERROR) .message("test") .id("foo") .suppressionReason("Some reason") .build(); }); }
@Test public void sameInstanceIsEqual() { ValidationEvent a = ValidationEvent.builder() .message("The message") .severity(Severity.SUPPRESSED) .shapeId(ShapeId.from("ns.foo#bar")) .id("abc.foo") .build(); assertEquals(a, a); }
@Test public void differentTypesAreNotEqual() { ValidationEvent a = ValidationEvent.builder() .message("The message") .severity(Severity.SUPPRESSED) .shapeId(ShapeId.from("ns.foo#bar")) .id("abc.foo") .build(); assertNotEquals(a, "test"); }