@Test public void shouldGenerateAtlasmapSchemaSetForUpdatePetRequest() throws IOException { final Operation swaggerOperation = swagger.getPaths().get(path).getOperationMap().get(operation); final DataShape shape = generator.createShapeFromRequest(json, swagger, swaggerOperation); final SoftAssertions softly = new SoftAssertions(); softly.assertThat(shape.getKind()).isEqualTo(DataShapeKinds.XML_SCHEMA); softly.assertThat(shape.getName()).isEqualTo("Request"); softly.assertThat(shape.getDescription()).isEqualTo("API request payload"); softly.assertThat(shape.getExemplar()).isNotPresent(); softly.assertAll(); final String expectedSpecification; try (InputStream in = UnifiedXmlDataShapeGenerator.class.getResourceAsStream("/swagger/" + schemaset)) { expectedSpecification = IOUtils.toString(in, StandardCharsets.UTF_8); } final String specification = shape.getSpecification(); assertThat(specification).isXmlEqualTo(expectedSpecification); }
@Test public void shouldGenerateAtlasmapSchemaSetForUpdatePetRequest() throws IOException { final Operation swaggerOperation = swagger.getPaths().get(path).getOperationMap().get(operation); final DataShape shape = generator.createShapeFromRequest(json, swagger, swaggerOperation); final SoftAssertions softly = new SoftAssertions(); softly.assertThat(shape.getKind()).isEqualTo(DataShapeKinds.XML_SCHEMA); softly.assertThat(shape.getName()).isEqualTo("Request"); softly.assertThat(shape.getDescription()).isEqualTo("API request payload"); softly.assertThat(shape.getExemplar()).isNotPresent(); softly.assertAll(); final String expectedSpecification; try (InputStream in = UnifiedXmlDataShapeGenerator.class.getResourceAsStream("/swagger/" + schemaset)) { expectedSpecification = IOUtils.toString(in, StandardCharsets.UTF_8); } final String specification = shape.getSpecification(); assertThat(specification).isXmlEqualTo(expectedSpecification); }
exemplar(exemplarOptional); String descriptionValue = instance.getDescription(); if (descriptionValue != null) { description(descriptionValue);