Skip to content

Commit

Permalink
refactor(tests): new location for 2.6.0 test resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakisan committed Oct 5, 2023
1 parent 944f338 commit d61c3f9
Show file tree
Hide file tree
Showing 81 changed files with 62 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class AsyncAPITest: SerDeTest<AsyncAPI>() {

override fun objectClass() = AsyncAPI::class.java

override fun baseObjectJson() = "/json/2.6.0/model/asyncapi.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/asyncapi.json"

override fun extendedObjectJson() = "/json/2.6.0/model/asyncapi - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/asyncapi - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/asyncapi - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/asyncapi - wrongly extended.json"

override fun build(): AsyncAPI {
return AsyncAPI(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ class ExternalDocumentationTest: SerDeTest<ExternalDocumentation>() {

override fun objectClass() = ExternalDocumentation::class.java

override fun baseObjectJson() = "/json/2.6.0/model/externalDocumentation.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/externalDocumentation.json"

override fun extendedObjectJson() = "/json/2.6.0/model/externalDocumentation - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/externalDocumentation - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/externalDocumentation - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/externalDocumentation - wrongly extended.json"

override fun build(): ExternalDocumentation {
return ExternalDocumentation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ReferenceTest {
@Test
@DisplayName("Compare hand crafted model with parsed json")
fun compareModelWithParsedJson() {
val model = ClasspathUtils.readAsString("/json/2.6.0/model/reference.json")
val model = ClasspathUtils.readAsString("/json/v2/2.6.0/model/reference.json")

Assertions.assertEquals(
objectMapper.readValue(model, Reference::class.java),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ class TagTest: SerDeTest<Tag>() {

override fun objectClass() = Tag::class.java

override fun baseObjectJson() = "/json/2.6.0/model/tag.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/tag.json"

override fun extendedObjectJson() = "/json/2.6.0/model/tag - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/tag - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/tag - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/tag - wrongly extended.json"

override fun build(): Tag {
return Tag(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class ChannelItemTest: SerDeTest<ChannelItem>() {

override fun objectClass() = ChannelItem::class.java

override fun baseObjectJson() = "/json/2.6.0/model/channel/channelItem.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/channel/channelItem.json"

override fun extendedObjectJson() = "/json/2.6.0/model/channel/channelItem - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/channel/channelItem - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/channel/channelItem - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/channel/channelItem - wrongly extended.json"

override fun build(): ChannelItem {
val subscribe = OperationWithOneOfMessageTest().build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ class ParameterWithReferenceToSchemaTest: SerDeTest<Parameter>() {

override fun objectClass() = Parameter::class.java

override fun baseObjectJson() = "/json/2.6.0/model/channel/parameter with reference to schema.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/channel/parameter with reference to schema.json"

override fun extendedObjectJson() = "/json/2.6.0/model/channel/parameter with reference to schema - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/channel/parameter with reference to schema - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/channel/parameter with reference to schema - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/channel/parameter with reference to schema - wrongly extended.json"

override fun build(): Parameter {
return Parameter.builder()
Expand All @@ -28,11 +28,11 @@ class ParameterWithSchemaTest: SerDeTest<Parameter>() {

override fun objectClass() = Parameter::class.java

override fun baseObjectJson() = "/json/2.6.0/model/channel/parameter with schema.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/channel/parameter with schema.json"

override fun extendedObjectJson() = "/json/2.6.0/model/channel/parameter with schema - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/channel/parameter with schema - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/channel/parameter with schema - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/channel/parameter with schema - wrongly extended.json"

override fun build(): Parameter {
return Parameter.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ class CorrelationIdTest: SerDeTest<CorrelationId>() {

override fun objectClass() = CorrelationId::class.java

override fun baseObjectJson() = "/json/2.6.0/model/channel/message/correlationId.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/channel/message/correlationId.json"

override fun extendedObjectJson() = "/json/2.6.0/model/channel/message/correlationId - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/channel/message/correlationId - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/channel/message/correlationId - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/channel/message/correlationId - wrongly extended.json"

override fun build(): CorrelationId {
return CorrelationId.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ class MessageExampleTest: SerDeTest<MessageExample>() {

override fun objectClass() = MessageExample::class.java

override fun baseObjectJson() = "/json/2.6.0/model/channel/message/messageExample.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/channel/message/messageExample.json"

override fun extendedObjectJson() = "/json/2.6.0/model/channel/message/messageExample - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/channel/message/messageExample - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/channel/message/messageExample - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/channel/message/messageExample - wrongly extended.json"

override fun build(): MessageExample {
return MessageExample.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class MessageTest: SerDeTest<Message>() {

override fun objectClass() = Message::class.java

override fun baseObjectJson() = "/json/2.6.0/model/channel/message/message.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/channel/message/message.json"

override fun extendedObjectJson() = "/json/2.6.0/model/channel/message/message - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/channel/message/message - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/channel/message/message - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/channel/message/message - wrongly extended.json"

override fun build(): Message {
return Message.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class MessageTraitTest: SerDeTest<MessageTrait>() {

override fun objectClass() = MessageTrait::class.java

override fun baseObjectJson() = "/json/2.6.0/model/channel/message/messageTrait.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/channel/message/messageTrait.json"

override fun extendedObjectJson() = "/json/2.6.0/model/channel/message/messageTrait - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/channel/message/messageTrait - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/channel/message/messageTrait - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/channel/message/messageTrait - wrongly extended.json"

override fun build(): MessageTrait {
return MessageTrait.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class OneOfMessagesTest {
@Test
@DisplayName("Compare hand crafted model with parsed json")
fun compareModelWithParsedJson() {
val model = ClasspathUtils.readAsString("/json/2.6.0/model/channel/message/oneOfMessages.json")
val model = ClasspathUtils.readAsString("/json/v2/2.6.0/model/channel/message/oneOfMessages.json")

Assertions.assertEquals(
objectMapper.readValue(model, OneOfMessages::class.java),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class OperationWithReferenceToMessageTest: SerDeTest<Operation>() {

override fun objectClass() = Operation::class.java

override fun baseObjectJson() = "/json/2.6.0/model/channel/operation/operation with reference to message.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/channel/operation/operation with reference to message.json"

override fun extendedObjectJson() = "/json/2.6.0/model/channel/operation/operation with reference to message - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/channel/operation/operation with reference to message - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/channel/operation/operation with reference to message - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/channel/operation/operation with reference to message - wrongly extended.json"

override fun build(): Operation {
return Operation.builder()
Expand Down Expand Up @@ -56,11 +56,11 @@ class OperationWithMessageTest: SerDeTest<Operation>() {

override fun objectClass() = Operation::class.java

override fun baseObjectJson() = "/json/2.6.0/model/channel/operation/operation with message.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/channel/operation/operation with message.json"

override fun extendedObjectJson() = "/json/2.6.0/model/channel/operation/operation with message - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/channel/operation/operation with message - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/channel/operation/operation with message - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/channel/operation/operation with message - wrongly extended.json"

override fun build(): Operation {
return Operation.builder()
Expand Down Expand Up @@ -94,11 +94,11 @@ class OperationWithOneOfMessageTest: SerDeTest<Operation>() {

override fun objectClass() = Operation::class.java

override fun baseObjectJson() = "/json/2.6.0/model/channel/operation/operation with oneOf message.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/channel/operation/operation with oneOf message.json"

override fun extendedObjectJson() = "/json/2.6.0/model/channel/operation/operation with oneOf message - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/channel/operation/operation with oneOf message - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/channel/operation/operation with oneOf message - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/channel/operation/operation with oneOf message - wrongly extended.json"

override fun build(): Operation {
return Operation.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ class OperationTraitTest: SerDeTest<OperationTrait>() {

override fun objectClass() = OperationTrait::class.java

override fun baseObjectJson() = "/json/2.6.0/model/channel/operation/operationTrait.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/channel/operation/operationTrait.json"

override fun extendedObjectJson() = "/json/2.6.0/model/channel/operation/operationTrait - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/channel/operation/operationTrait - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/channel/operation/operationTrait - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/channel/operation/operationTrait - wrongly extended.json"

override fun build(): OperationTrait {
return OperationTrait.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ class ComponentsTest: SerDeTest<Components>() {

override fun objectClass() = Components::class.java

override fun baseObjectJson() = "/json/2.6.0/model/components/components.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/components/components.json"

override fun extendedObjectJson() = "/json/2.6.0/model/components/components - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/components/components - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/components/components - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/components/components - wrongly extended.json"

override fun build(): Components {
return Components.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ class ContactTest: SerDeTest<Contact>() {

override fun objectClass() = Contact::class.java

override fun baseObjectJson() = "/json/2.6.0/model/info/contact.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/info/contact.json"

override fun extendedObjectJson() = "/json/2.6.0/model/info/contact - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/info/contact - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/info/contact - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/info/contact - wrongly extended.json"

override fun build(): Contact {
return Contact(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ class InfoTest: SerDeTest<Info>() {

override fun objectClass() = Info::class.java

override fun baseObjectJson() = "/json/2.6.0/model/info/info.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/info/info.json"

override fun extendedObjectJson() = "/json/2.6.0/model/info/info - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/info/info - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/info/info - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/info/info - wrongly extended.json"

override fun build(): Info {
return Info(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ class LicenseTest: SerDeTest<License>() {

override fun objectClass() = License::class.java

override fun baseObjectJson() = "/json/2.6.0/model/info/license.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/info/license.json"

override fun extendedObjectJson() = "/json/2.6.0/model/info/license - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/info/license - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/info/license - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/info/license - wrongly extended.json"

override fun build(): License {
return License(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class ServerTest: SerDeTest<Server>() {

override fun objectClass() = Server::class.java

override fun baseObjectJson() = "/json/2.6.0/model/server/server.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/server/server.json"

override fun extendedObjectJson() = "/json/2.6.0/model/server/server - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/server/server - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/server/server - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/server/server - wrongly extended.json"

override fun build(): Server {
return Server.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ class ServerVariableTest: SerDeTest<ServerVariable>() {

override fun objectClass() = ServerVariable::class.java

override fun baseObjectJson() = "/json/2.6.0/model/server/serverVariable.json"
override fun baseObjectJson() = "/json/v2/2.6.0/model/server/serverVariable.json"

override fun extendedObjectJson() = "/json/2.6.0/model/server/serverVariable - extended.json"
override fun extendedObjectJson() = "/json/v2/2.6.0/model/server/serverVariable - extended.json"

override fun wronglyExtendedObjectJson() = "/json/2.6.0/model/server/serverVariable - wrongly extended.json"
override fun wronglyExtendedObjectJson() = "/json/v2/2.6.0/model/server/serverVariable - wrongly extended.json"

override fun build(): ServerVariable {
return ServerVariable.builder()
Expand Down

0 comments on commit d61c3f9

Please sign in to comment.