Skip to content

Commit d7df464

Browse files
committed
Updating Asciidoc test to verify valid output
1 parent 4a7236d commit d7df464

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

core/src/test/java/org/openapitools/openapidiff/core/AsciidocRenderTest.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,32 @@ public void renderDoesNotFailWhenHTTPStatusCodeIsRange() {
4040
render.render(diff, outputStreamWriter);
4141
assertThat(outputStream.toString()).isNotBlank();
4242
}
43+
44+
@Test
45+
public void validateAsciiDocChangeFile() {
46+
AsciidocRender render = new AsciidocRender();
47+
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
48+
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream);
49+
ChangedOpenApi diff =
50+
OpenApiCompare.fromLocations("missing_property_1.yaml", "missing_property_2.yaml");
51+
render.render(diff, outputStreamWriter);
52+
assertThat(outputStream.toString())
53+
.isEqualTo(
54+
"= TITLE (v 1.0.0)\n"
55+
+ ":reproducible:\n"
56+
+ ":sectlinks:\n"
57+
+ ":toc:\n"
58+
+ "\n"
59+
+ "== What's Changed\n"
60+
+ "=== GET /\n"
61+
+ "* Return Type:\n"
62+
+ "** Changed default \n"
63+
+ "** Media types:\n"
64+
+ "*** Changed application/json\n"
65+
+ "*** Schema:\n"
66+
+ "Backward compatible\n"
67+
+ "\n"
68+
+ "\n"
69+
+ "NOTE: API changes are backward compatible\n");
70+
}
4371
}

0 commit comments

Comments
 (0)