Skip to content

Commit

Permalink
Revert "feat(impl): [#559] write irs-api.actual.yaml if there are dif…
Browse files Browse the repository at this point in the history
…ferences (to simplify comparison)"

This reverts commit 7e61c02.
  • Loading branch information
ds-jhartmann committed May 13, 2024
1 parent fc677a8 commit 03a7e5f
Showing 1 changed file with 14 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -89,25 +88,20 @@ void generatedOpenApiMatchesContract() throws Exception {
final Map<String, Object> definedYamlMap = mapper.readerForMapOf(Object.class).readValue(definedYaml);
final Map<String, Object> generatedYamlMap = mapper.readerForMapOf(Object.class).readValue(generatedYaml);

try {
// 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);
} catch (AssertionError e) {
// write changed API to file for easier comparison
Files.writeString(Paths.get("../docs/src/api/irs-api.actual.yaml"), generatedYaml);
}
// 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);

}

Expand Down

0 comments on commit 03a7e5f

Please sign in to comment.