MockIntegrationTrait extends AbstractTrait implements ToSmithyBuilder<MockIntegrationTrait> { @Override public Builder toBuilder() { return builder() .passThroughBehavior(passThroughBehavior) .contentHandling(contentHandling) .requestParameters(requestParameters) .requestTemplates(requestTemplates) .responses(responses); } private  MockIntegrationTrait(Builder builder); static Builder builder(); Optional<String> getPassThroughBehavior(); Map<String, String> getRequestParameters(); Optional<String> getRequestParameter(String expression); Map<String, String> getRequestTemplates(); Optional<String> getRequestTemplate(String mimeType); Map<String, IntegrationResponse> getResponses(); Optional<IntegrationResponse> getResponse(String statusCode); Optional<String> getContentHandling(); @Override Builder toBuilder(); static final ShapeId ID; }
@Test public void loadsTraitFromModel() { Model model = Model.assembler() .discoverModels(getClass().getClassLoader()) .addImport(TestRunnerTest.class.getResource("errorfiles/valid-integration.json")) .assemble() .unwrap(); MockIntegrationTrait trait = model.expectShape(ShapeId.from("ns.foo#Operation")) .getTrait(MockIntegrationTrait.class) .get(); assertThat(trait.toBuilder().build(), equalTo(trait)); assertThat(new MockIntegrationTrait.Provider().createTrait(ShapeId.from("ns.foo#Operation"), trait.toNode()), equalTo(trait)); }