Skip to content

Commit

Permalink
feat(3.0.0): Tag tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakisan committed Sep 24, 2023
1 parent e4fa43d commit b44f5f0
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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<Tag>() {

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<Tag>() {

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()
)
}

}
Original file line number Diff line number Diff line change
@@ -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" : { }
}
}
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name" : "user",
"description" : "User-related messages",
"externalDocs" : {
"$ref" : "#/components/external-doc"
},
"x-number" : 0,
"x-string" : "",
"x-object" : {
"property" : { }
}
}
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "user",
"description": "User-related messages",
"externalDocs": {
"$ref": "#/components/external-doc"
}
}
8 changes: 8 additions & 0 deletions asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "user",
"description": "User-related messages",
"externalDocs": {
"description" : "Find more info here",
"url" : "https://example.com"
}
}

0 comments on commit b44f5f0

Please sign in to comment.