Class SmithyDiffTestCase
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Thrown when errors are encountered while unwrapping a test case.static final class
Output of diffing a model against a test case. -
Constructor Summary
ConstructorDescriptionSmithyDiffTestCase
(Path path, String name, List<ValidationEvent> expectedEvents) -
Method Summary
Modifier and TypeMethodDescriptioncreateResult
(List<ValidationEvent> actualEvents) Creates a test case result from a list of model diff events.static SmithyDiffTestCase
Creates a test case from a test case path and name.Gets the expected validation events.getName()
Gets the name of the test case.getPath()
Gets the parent path of the test case.
-
Constructor Details
-
SmithyDiffTestCase
- Parameters:
path
- Parent path of where the model and event files are stored.name
- Name of the test caseexpectedEvents
- The expected diff events to encounter.
-
-
Method Details
-
from
Creates a test case from a test case path and name.The models and events file are expected to be stored in the same directory as the model and events file are assumed to be named the same barring the file extensions: `.a.(json|smithy)`, `.b.(json|smithy)`, `.events`.
The accompanying events file is a `-----` separated list of event strings, where each event is defined in the following format:
[SEVERITY] shapeId message | EventId filename:line:column
. A shapeId of "-" means that a specific shape is not targeted.- Parameters:
path
- Parent path of where the model and event files are stored.name
- Name of the test case- Returns:
- Returns the created test case.
-
getPath
Gets the parent path of the test case.- Returns:
- parent path of the test case.
-
getName
Gets the name of the test case.- Returns:
- name of the test case.
-
getExpectedEvents
Gets the expected validation events.- Returns:
- Expected validation events.
-
createResult
Creates a test case result from a list of model diff events.The diff events encountered are compared against the expected validation events. An actual event (A) is considered a match with an expected event (E) if A and E target the same shape, have the same severity, the eventId of A contains the eventId of E, and the message of E starts with the suppression reason or message of A.
- Parameters:
actualEvents
- List of actual diff events.- Returns:
- Returns the created test case result.
-