diff --git a/irs-api/src/test/java/org/eclipse/tractusx/irs/IrsApplicationTests.java b/irs-api/src/test/java/org/eclipse/tractusx/irs/IrsApplicationTests.java index 8fc619a1e5..c3b0e50fc1 100644 --- a/irs-api/src/test/java/org/eclipse/tractusx/irs/IrsApplicationTests.java +++ b/irs-api/src/test/java/org/eclipse/tractusx/irs/IrsApplicationTests.java @@ -77,11 +77,12 @@ class IrsApplicationTests { @Test void generatedOpenApiMatchesContract() throws Exception { - final String generatedYaml = this.restTemplate.getForObject("http://localhost:" + port + "/api/api-docs.yaml", String.class); - final InputStream fixedYaml = Files.newInputStream(Path.of("../docs/src/api/irs-api.yaml")); + final String generatedYaml = this.restTemplate.getForObject("http://localhost:" + port + "/api/api-docs.yaml", + String.class); + final InputStream definedYaml = Files.newInputStream(Path.of("../docs/src/api/irs-api.yaml")); final ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); - final Map fixedYamlMap = mapper.readerForMapOf(Object.class).readValue(fixedYaml); + final Map definedYamlMap = mapper.readerForMapOf(Object.class).readValue(definedYaml); final Map generatedYamlMap = mapper.readerForMapOf(Object.class).readValue(generatedYaml); // To correctly display both documentations examples - manual and generated by annotations - @@ -93,7 +94,8 @@ void generatedOpenApiMatchesContract() throws Exception { .ignoringFields("components.schemas.Jobs.example") .ignoringFields("components.schemas.Policy") .ignoringFields("components.schemas.BatchResponse.example") - .isEqualTo(fixedYamlMap); + .isEqualTo(definedYamlMap); + } @Test