From ff94ac5c8b68b86c8f9fbf141f29a77b54e1713c Mon Sep 17 00:00:00 2001 From: ktsypkina Date: Mon, 4 Mar 2024 12:34:22 +0100 Subject: [PATCH] add test to cover parsed with errors case --- .../zalando/zally/core/DefaultContextFactoryTest.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/zally-core/src/test/kotlin/org/zalando/zally/core/DefaultContextFactoryTest.kt b/server/zally-core/src/test/kotlin/org/zalando/zally/core/DefaultContextFactoryTest.kt index 7e7ce9ba9..071fc25f7 100644 --- a/server/zally-core/src/test/kotlin/org/zalando/zally/core/DefaultContextFactoryTest.kt +++ b/server/zally-core/src/test/kotlin/org/zalando/zally/core/DefaultContextFactoryTest.kt @@ -23,6 +23,16 @@ class DefaultContextFactoryTest { assertThat(result).resultsInNotApplicable() } + @Test + fun `OPEN API -- Openapi property is expected to be String according to the OpenAPI3 spec`() { + @Language("YAML") + val content = """ + openapi: {la: 3.0.0} + """ + val result = defaultContextFactory.parseOpenApiContext(content) + assertThat(result).resultsInParsedWithErrors() + } + @Test fun `OPEN API -- not applicable when content does not contain the openapi property`() { @Language("YAML")