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 c3b0e50fc1..da34d33cc1 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 @@ -56,7 +56,9 @@ import org.springframework.test.context.ActiveProfiles; @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = { "digitalTwinRegistry.type=central" }) -@ActiveProfiles(profiles = { "local", "test" }) +@ActiveProfiles(profiles = { "local", + "test" +}) @Import(TestConfig.class) class IrsApplicationTests { @@ -77,6 +79,7 @@ class IrsApplicationTests { @Test void generatedOpenApiMatchesContract() throws Exception { + 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")); @@ -87,14 +90,18 @@ void generatedOpenApiMatchesContract() throws Exception { // To correctly display both documentations examples - manual and generated by annotations - // we need to remove verification for some "examples", otherwise one or another won't display correctly - assertThat(generatedYamlMap).usingRecursiveComparison() - .ignoringFields("components.schemas.PageResult.example") - .ignoringFields("components.schemas.AspectModels.example") - .ignoringFields("components.schemas.BatchOrderResponse.example") - .ignoringFields("components.schemas.Jobs.example") - .ignoringFields("components.schemas.Policy") - .ignoringFields("components.schemas.BatchResponse.example") - .isEqualTo(definedYamlMap); + assertThat(generatedYamlMap) + + .usingRecursiveComparison() + + .ignoringFields("components.schemas.PageResult.example") + .ignoringFields("components.schemas.AspectModels.example") + .ignoringFields("components.schemas.BatchOrderResponse.example") + .ignoringFields("components.schemas.Jobs.example") + .ignoringFields("components.schemas.Policy") + .ignoringFields("components.schemas.BatchResponse.example") + + .isEqualTo(definedYamlMap); } @@ -109,7 +116,6 @@ void shouldStoreBlobResultWhenRunningJob() throws Exception { final JobInitiateResponse response = jobOrchestrator.startJob("rootitemid", jobParameter, null); - assertThat(response.getStatus()).isEqualTo(ResponseStatus.OK); Awaitility.await()