diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/_0_0/model/TagTest.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/_0_0/model/TagTest.kt new file mode 100644 index 00000000..e18a3ca9 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/_0_0/model/TagTest.kt @@ -0,0 +1,50 @@ +package com.asyncapi.v3._0_0.model + +import com.asyncapi.v3.Reference +import com.asyncapi.v3.SerDeTest + +/** + * @author Pavel Bodiachevskii + */ +class TagTestWithReferenceToExternalDocs: SerDeTest() { + + override fun objectClass() = Tag::class.java + + override fun baseObjectJson() = "/json/v3/3.0.0/model/tag with reference to externalDocs.json" + + override fun extendedObjectJson() = "/json/v3/3.0.0/model/tag with reference to externalDocs - extended.json" + + override fun wronglyExtendedObjectJson() = "/json/v3/3.0.0/model/tag with reference to externalDocs - wrongly extended.json" + + override fun build(): Tag { + return Tag( + "user", + "User-related messages", + Reference("#/components/external-doc") + ) + } + +} + +/** + * @author Pavel Bodiachevskii + */ +class TagTest: SerDeTest() { + + override fun objectClass() = Tag::class.java + + override fun baseObjectJson() = "/json/v3/3.0.0/model/tag.json" + + override fun extendedObjectJson() = "/json/v3/3.0.0/model/tag - extended.json" + + override fun wronglyExtendedObjectJson() = "/json/v3/3.0.0/model/tag - wrongly extended.json" + + override fun build(): Tag { + return Tag( + "user", + "User-related messages", + ExternalDocumentationTest().build() + ) + } + +} diff --git a/asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag - extended.json b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag - extended.json new file mode 100644 index 00000000..d41b395e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag - extended.json @@ -0,0 +1,13 @@ +{ + "name" : "user", + "description" : "User-related messages", + "externalDocs" : { + "description" : "Find more info here", + "url" : "https://example.com" + }, + "x-number" : 0, + "x-string" : "", + "x-object" : { + "property" : { } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag - wrongly extended.json b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag - wrongly extended.json new file mode 100644 index 00000000..7a65e27e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag - wrongly extended.json @@ -0,0 +1,14 @@ +{ + "name": "user", + "description": "User-related messages", + "externalDocs": { + "description" : "Find more info here", + "url" : "https://example.com" + }, + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 +} diff --git a/asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag with reference to externalDocs - extended.json b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag with reference to externalDocs - extended.json new file mode 100644 index 00000000..1d10e2f8 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag with reference to externalDocs - extended.json @@ -0,0 +1,12 @@ +{ + "name" : "user", + "description" : "User-related messages", + "externalDocs" : { + "$ref" : "#/components/external-doc" + }, + "x-number" : 0, + "x-string" : "", + "x-object" : { + "property" : { } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag with reference to externalDocs - wrongly extended.json b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag with reference to externalDocs - wrongly extended.json new file mode 100644 index 00000000..79e4f263 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag with reference to externalDocs - wrongly extended.json @@ -0,0 +1,13 @@ +{ + "name": "user", + "description": "User-related messages", + "externalDocs": { + "$ref": "#/components/external-doc" + }, + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 +} diff --git a/asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag with reference to externalDocs.json b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag with reference to externalDocs.json new file mode 100644 index 00000000..f9ad85f8 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag with reference to externalDocs.json @@ -0,0 +1,7 @@ +{ + "name": "user", + "description": "User-related messages", + "externalDocs": { + "$ref": "#/components/external-doc" + } +} diff --git a/asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag.json b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag.json new file mode 100644 index 00000000..aa06e030 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag.json @@ -0,0 +1,8 @@ +{ + "name": "user", + "description": "User-related messages", + "externalDocs": { + "description" : "Find more info here", + "url" : "https://example.com" + } +}