TraceFile implements ToNode, ToSmithyBuilder<TraceFile> { @Override public Builder toBuilder() { return builder() .metadata(metadata) .smithyTrace(smithyTrace) .definitions(artifactDefinitions) .shapes(shapes); } private  TraceFile(Builder builder); static TraceFile fromNode(Node value); static Builder builder(); @Override ObjectNode toNode(); void validateModel(Model model); String getSmithyTrace(); TraceMetadata getMetadata(); Optional<ArtifactDefinitions> getArtifactDefinitions(); Map<ShapeId, List<ShapeLink>> getShapes(); @Override Builder toBuilder(); static final String SMITHY_TRACE_TEXT; static final String METADATA_TEXT; static final String DEFINITIONS_TEXT; static final String SHAPES_TEXT; static final String SMITHY_TRACE_VERSION; }
@Test void buildThrowsWithNoSmithyTrace() { Assertions.assertThrows(IllegalStateException.class, () -> { TraceFile traceFile = parseTraceFileFromFile(getClass().getResource("trace-file.json").toURI()); traceFile.toBuilder().smithyTrace(null).build(); }); }
@Test void buildThrowsWithNoTraceMetadata() { Assertions.assertThrows(IllegalStateException.class, () -> { TraceFile traceFile = parseTraceFileFromFile(getClass().getResource("trace-file.json").toURI()); traceFile.toBuilder().metadata(null).build(); }); }
@Test void buildThrowsWithNoShapes() { Assertions.assertThrows(NullPointerException.class, () -> { TraceFile traceFile = parseTraceFileFromFile(getClass().getResource("trace-file.json").toURI()); traceFile.toBuilder().shapes(null).build(); }); }