Skip to content

Commit

Permalink
fix(impl): [#199] code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmf committed Apr 10, 2024
1 parent 77fb94a commit da16713
Showing 1 changed file with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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"));
Expand All @@ -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);

}

Expand All @@ -109,7 +116,6 @@ void shouldStoreBlobResultWhenRunningJob() throws Exception {

final JobInitiateResponse response = jobOrchestrator.startJob("rootitemid", jobParameter, null);


assertThat(response.getStatus()).isEqualTo(ResponseStatus.OK);

Awaitility.await()
Expand Down

0 comments on commit da16713

Please sign in to comment.