forked from asyncapi/jasyncapi
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
asyncapi-core/src/test/kotlin/com/asyncapi/v3/_0_0/model/TagTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
) | ||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag - extended.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" : { } | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag - wrongly extended.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
12 changes: 12 additions & 0 deletions
12
...src/test/resources/json/v3/3.0.0/model/tag with reference to externalDocs - extended.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" : { } | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
.../resources/json/v3/3.0.0/model/tag with reference to externalDocs - wrongly extended.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
7 changes: 7 additions & 0 deletions
7
asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag with reference to externalDocs.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
8
asyncapi-core/src/test/resources/json/v3/3.0.0/model/tag.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |