From 1383ad7a709e1abd9b9268bf3b2a4adbc1300e3b Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Mon, 29 Apr 2024 21:51:30 +0400 Subject: [PATCH] tests(bindings): SQS 0.1.0 https://github.com/asyncapi/jasyncapi/issues/184 https://github.com/asyncapi/jasyncapi/issues/181 --- .../bindings/sqs/SQSChannelBinding.java | 33 +++++++++ .../bindings/sqs/SQSMessageBinding.java | 33 +++++++++ .../bindings/sqs/SQSOperationBinding.java | 33 +++++++++ .../bindings/sqs/SQSServerBinding.java | 33 +++++++++ .../v0/_1_0/channel/SQSChannelBinding.java | 14 +++- .../v0/_1_0/message/SQSMessageBinding.java | 14 +++- .../_1_0/operation/SQSOperationBinding.java | 14 +++- .../sqs/v0/_1_0/server/SQSServerBinding.java | 14 +++- .../kotlin/com/asyncapi/bindings/sqs/SQS.java | 11 +++ .../asyncapi/bindings/sqs/SQSLatestTest.java | 54 ++++++++++++++ .../bindings/sqs/SQSUnknownVersionTest.java | 54 ++++++++++++++ .../asyncapi/bindings/sqs/SQSV0_1_0Test.java | 70 +++++++++++++++++++ .../bindings/sqs/SQSWithoutVersionTest.java | 54 ++++++++++++++ .../v2/2.0.0/model/asyncapi - extended.json | 56 +++++++++++---- .../model/channel/channelItem - extended.json | 24 +++++-- .../channel/message/message - extended.json | 4 +- .../message/messageTrait - extended.json | 4 +- .../operation with message - extended.json | 12 +++- ... with reference to message - extended.json | 8 ++- .../operation/operationTrait - extended.json | 4 +- .../components/components - extended.json | 28 ++++++-- .../2.0.0/model/server/server - extended.json | 4 +- .../v2/2.6.0/model/asyncapi - extended.json | 12 +++- .../components/components - extended.json | 8 ++- .../2.6.0/model/server/server - extended.json | 4 +- .../v3/3.0.0/model/asyncapi - extended.json | 16 +++-- .../components/components - extended.json | 8 ++- .../3.0.0/model/server/server - extended.json | 4 +- .../server with reference - extended.json | 4 +- 29 files changed, 577 insertions(+), 54 deletions(-) create mode 100644 asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/SQSChannelBinding.java create mode 100644 asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/SQSMessageBinding.java create mode 100644 asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/SQSOperationBinding.java create mode 100644 asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/SQSServerBinding.java create mode 100644 asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQS.java create mode 100644 asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQSLatestTest.java create mode 100644 asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQSUnknownVersionTest.java create mode 100644 asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQSV0_1_0Test.java create mode 100644 asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQSWithoutVersionTest.java diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/SQSChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/SQSChannelBinding.java new file mode 100644 index 00000000..a94a7d7b --- /dev/null +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/SQSChannelBinding.java @@ -0,0 +1,33 @@ +package com.asyncapi.bindings.sqs; + +import com.asyncapi.bindings.ChannelBinding; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import lombok.EqualsAndHashCode; + +/** + * This class MUST NOT contain any properties. + *

+ * Its name is reserved for future use. + *

+ * Describes SQS channel binding. + * + * @version 0.1.0 + * @see SQS channel binding + * @author Pavel Bodiachevskii + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.EXISTING_PROPERTY, + defaultImpl = com.asyncapi.bindings.sqs.v0._1_0.channel.SQSChannelBinding.class, + property = "bindingVersion", + visible = true +) +@JsonSubTypes({ + @JsonSubTypes.Type(value = com.asyncapi.bindings.sqs.v0._1_0.channel.SQSChannelBinding.class, names = { + "0.1.0", + "latest" + }), +}) +@EqualsAndHashCode(callSuper = true) +public class SQSChannelBinding extends ChannelBinding {} \ No newline at end of file diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/SQSMessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/SQSMessageBinding.java new file mode 100644 index 00000000..d46ae4a8 --- /dev/null +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/SQSMessageBinding.java @@ -0,0 +1,33 @@ +package com.asyncapi.bindings.sqs; + +import com.asyncapi.bindings.MessageBinding; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import lombok.EqualsAndHashCode; + +/** + * This class MUST NOT contain any properties. + *

+ * Its name is reserved for future use. + *

+ * Describes SQS message binding. + * + * @version 0.1.0 + * @see SQS message binding + * @author Pavel Bodiachevskii + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.EXISTING_PROPERTY, + defaultImpl = com.asyncapi.bindings.sqs.v0._1_0.message.SQSMessageBinding.class, + property = "bindingVersion", + visible = true +) +@JsonSubTypes({ + @JsonSubTypes.Type(value = com.asyncapi.bindings.sqs.v0._1_0.message.SQSMessageBinding.class, names = { + "0.1.0", + "latest" + }), +}) +@EqualsAndHashCode(callSuper = true) +public class SQSMessageBinding extends MessageBinding {} \ No newline at end of file diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/SQSOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/SQSOperationBinding.java new file mode 100644 index 00000000..0d950ea7 --- /dev/null +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/SQSOperationBinding.java @@ -0,0 +1,33 @@ +package com.asyncapi.bindings.sqs; + +import com.asyncapi.bindings.OperationBinding; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import lombok.EqualsAndHashCode; + +/** + * This class MUST NOT contain any properties. + *

+ * Its name is reserved for future use. + *

+ * Describes SQS operation binding. + * + * @version 0.1.0 + * @see SQS operation binding + * @author Pavel Bodiachevskii + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.EXISTING_PROPERTY, + defaultImpl = com.asyncapi.bindings.sqs.v0._1_0.operation.SQSOperationBinding.class, + property = "bindingVersion", + visible = true +) +@JsonSubTypes({ + @JsonSubTypes.Type(value = com.asyncapi.bindings.sqs.v0._1_0.operation.SQSOperationBinding.class, names = { + "0.1.0", + "latest" + }), +}) +@EqualsAndHashCode(callSuper = true) +public class SQSOperationBinding extends OperationBinding {} \ No newline at end of file diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/SQSServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/SQSServerBinding.java new file mode 100644 index 00000000..f95943f1 --- /dev/null +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/SQSServerBinding.java @@ -0,0 +1,33 @@ +package com.asyncapi.bindings.sqs; + +import com.asyncapi.bindings.ServerBinding; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import lombok.EqualsAndHashCode; + +/** + * This class MUST NOT contain any properties. + *

+ * Its name is reserved for future use. + *

+ * Describes SQS server binding. + * + * @version 0.1.0 + * @see SQS server binding + * @author Pavel Bodiachevskii + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.EXISTING_PROPERTY, + defaultImpl = com.asyncapi.bindings.sqs.v0._1_0.server.SQSServerBinding.class, + property = "bindingVersion", + visible = true +) +@JsonSubTypes({ + @JsonSubTypes.Type(value = com.asyncapi.bindings.sqs.v0._1_0.server.SQSServerBinding.class, names = { + "0.1.0", + "latest" + }), +}) +@EqualsAndHashCode(callSuper = true) +public class SQSServerBinding extends ServerBinding {} \ No newline at end of file diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/v0/_1_0/channel/SQSChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/v0/_1_0/channel/SQSChannelBinding.java index 4f79e1c9..2bd39fe8 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/v0/_1_0/channel/SQSChannelBinding.java +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/v0/_1_0/channel/SQSChannelBinding.java @@ -4,6 +4,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import org.jetbrains.annotations.Nullable; /** * This class MUST NOT contain any properties. @@ -19,5 +20,16 @@ @Data @NoArgsConstructor @EqualsAndHashCode(callSuper = true) -public class SQSChannelBinding extends ChannelBinding { +public class SQSChannelBinding extends com.asyncapi.bindings.sqs.SQSChannelBinding { + + @Override + public String getBindingVersion() { + return "0.1.0"; + } + + @Override + public void setBindingVersion(@Nullable String bindingVersion) { + super.setBindingVersion("0.1.0"); + } + } diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/v0/_1_0/message/SQSMessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/v0/_1_0/message/SQSMessageBinding.java index 357c9af6..3e23fc1d 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/v0/_1_0/message/SQSMessageBinding.java +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/v0/_1_0/message/SQSMessageBinding.java @@ -4,6 +4,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import org.jetbrains.annotations.Nullable; /** * This class MUST NOT contain any properties. @@ -19,5 +20,16 @@ @Data @NoArgsConstructor @EqualsAndHashCode(callSuper = true) -public class SQSMessageBinding extends MessageBinding { +public class SQSMessageBinding extends com.asyncapi.bindings.sqs.SQSMessageBinding { + + @Override + public String getBindingVersion() { + return "0.1.0"; + } + + @Override + public void setBindingVersion(@Nullable String bindingVersion) { + super.setBindingVersion("0.1.0"); + } + } diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/v0/_1_0/operation/SQSOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/v0/_1_0/operation/SQSOperationBinding.java index b47c31e4..e39c810b 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/v0/_1_0/operation/SQSOperationBinding.java +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/v0/_1_0/operation/SQSOperationBinding.java @@ -4,6 +4,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import org.jetbrains.annotations.Nullable; /** * This class MUST NOT contain any properties. @@ -19,5 +20,16 @@ @Data @NoArgsConstructor @EqualsAndHashCode(callSuper = true) -public class SQSOperationBinding extends OperationBinding { +public class SQSOperationBinding extends com.asyncapi.bindings.sqs.SQSOperationBinding { + + @Override + public String getBindingVersion() { + return "0.1.0"; + } + + @Override + public void setBindingVersion(@Nullable String bindingVersion) { + super.setBindingVersion("0.1.0"); + } + } diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/v0/_1_0/server/SQSServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/v0/_1_0/server/SQSServerBinding.java index bfbc27af..5f2e2244 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/v0/_1_0/server/SQSServerBinding.java +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/sqs/v0/_1_0/server/SQSServerBinding.java @@ -4,6 +4,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import org.jetbrains.annotations.Nullable; /** * This class MUST NOT contain any properties. @@ -19,5 +20,16 @@ @Data @NoArgsConstructor @EqualsAndHashCode(callSuper = true) -public class SQSServerBinding extends ServerBinding { +public class SQSServerBinding extends com.asyncapi.bindings.sqs.SQSServerBinding { + + @Override + public String getBindingVersion() { + return "0.1.0"; + } + + @Override + public void setBindingVersion(@Nullable String bindingVersion) { + super.setBindingVersion("0.1.0"); + } + } diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQS.java b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQS.java new file mode 100644 index 00000000..07765c2f --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQS.java @@ -0,0 +1,11 @@ +package com.asyncapi.bindings.sqs; + +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; +import org.junit.platform.suite.api.SuiteDisplayName; + +@Suite +@SuiteDisplayName("SQS") +@SelectPackages("com.asyncapi.bindings.sqs") +public class SQS { +} diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQSLatestTest.java b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQSLatestTest.java new file mode 100644 index 00000000..e032e1e5 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQSLatestTest.java @@ -0,0 +1,54 @@ +package com.asyncapi.bindings.sqs; + +import com.asyncapi.bindings.BindingTest; +import com.asyncapi.bindings.sqs.v0._1_0.channel.SQSChannelBinding; +import com.asyncapi.bindings.sqs.v0._1_0.message.SQSMessageBinding; +import com.asyncapi.bindings.sqs.v0._1_0.operation.SQSOperationBinding; +import com.asyncapi.bindings.sqs.v0._1_0.server.SQSServerBinding; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Nested; + +@DisplayName("latest") +public class SQSLatestTest { + + @Nested + @DisplayName("channel") + class ChannelTest extends BindingTest {{ + super.binding = SQSV0_1_0Test.channelBinding(); + super.bindingTypeClass = SQSChannelBinding.class; + super.pathToBindingJson = "/bindings/default implementation/latest/channel/binding.json"; + super.pathToExtendedBindingJson = "/bindings/default implementation/latest/channel/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/default implementation/latest/channel/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("message") + class Message extends BindingTest {{ + super.binding = SQSV0_1_0Test.messageBinding(); + super.bindingTypeClass = SQSMessageBinding.class; + super.pathToBindingJson = "/bindings/default implementation/latest/message/binding.json"; + super.pathToExtendedBindingJson = "/bindings/default implementation/latest/message/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/default implementation/latest/message/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("operation") + class Operation extends BindingTest {{ + super.binding = SQSV0_1_0Test.operationBinding(); + super.bindingTypeClass = SQSOperationBinding.class; + super.pathToBindingJson = "/bindings/default implementation/latest/operation/binding.json"; + super.pathToExtendedBindingJson = "/bindings/default implementation/latest/operation/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/default implementation/latest/operation/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("server") + class Server extends BindingTest {{ + super.binding = SQSV0_1_0Test.serverBinding(); + super.bindingTypeClass = SQSServerBinding.class; + super.pathToBindingJson = "/bindings/default implementation/latest/server/binding.json"; + super.pathToExtendedBindingJson = "/bindings/default implementation/latest/server/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/default implementation/latest/server/binding - wrongly extended.json"; + }} + +} diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQSUnknownVersionTest.java b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQSUnknownVersionTest.java new file mode 100644 index 00000000..5cb3a0f2 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQSUnknownVersionTest.java @@ -0,0 +1,54 @@ +package com.asyncapi.bindings.sqs; + +import com.asyncapi.bindings.BindingTest; +import com.asyncapi.bindings.sqs.v0._1_0.channel.SQSChannelBinding; +import com.asyncapi.bindings.sqs.v0._1_0.message.SQSMessageBinding; +import com.asyncapi.bindings.sqs.v0._1_0.operation.SQSOperationBinding; +import com.asyncapi.bindings.sqs.v0._1_0.server.SQSServerBinding; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Nested; + +@DisplayName("unknown version") +public class SQSUnknownVersionTest { + + @Nested + @DisplayName("channel") + class ChannelTest extends BindingTest {{ + super.binding = SQSV0_1_0Test.channelBinding(); + super.bindingTypeClass = SQSChannelBinding.class; + super.pathToBindingJson = "/bindings/default implementation/unknown version/channel/binding.json"; + super.pathToExtendedBindingJson = "/bindings/default implementation/unknown version/channel/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/default implementation/unknown version/channel/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("message") + class Message extends BindingTest {{ + super.binding = SQSV0_1_0Test.messageBinding(); + super.bindingTypeClass = SQSMessageBinding.class; + super.pathToBindingJson = "/bindings/default implementation/unknown version/message/binding.json"; + super.pathToExtendedBindingJson = "/bindings/default implementation/unknown version/message/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/default implementation/unknown version/message/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("operation") + class Operation extends BindingTest {{ + super.binding = SQSV0_1_0Test.operationBinding(); + super.bindingTypeClass = SQSOperationBinding.class; + super.pathToBindingJson = "/bindings/default implementation/unknown version/operation/binding.json"; + super.pathToExtendedBindingJson = "/bindings/default implementation/unknown version/operation/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/default implementation/unknown version/operation/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("server") + class Server extends BindingTest {{ + super.binding = SQSV0_1_0Test.serverBinding(); + super.bindingTypeClass = SQSServerBinding.class; + super.pathToBindingJson = "/bindings/default implementation/unknown version/server/binding.json"; + super.pathToExtendedBindingJson = "/bindings/default implementation/unknown version/server/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/default implementation/unknown version/server/binding - wrongly extended.json"; + }} + +} diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQSV0_1_0Test.java b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQSV0_1_0Test.java new file mode 100644 index 00000000..e47c2432 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQSV0_1_0Test.java @@ -0,0 +1,70 @@ +package com.asyncapi.bindings.sqs; + +import com.asyncapi.bindings.BindingTest; +import com.asyncapi.bindings.sqs.v0._1_0.channel.SQSChannelBinding; +import com.asyncapi.bindings.sqs.v0._1_0.message.SQSMessageBinding; +import com.asyncapi.bindings.sqs.v0._1_0.operation.SQSOperationBinding; +import com.asyncapi.bindings.sqs.v0._1_0.server.SQSServerBinding; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Nested; + +@DisplayName("0.1.0") +public class SQSV0_1_0Test { + + public static SQSChannelBinding channelBinding () { + return new SQSChannelBinding(); + } + + public static SQSMessageBinding messageBinding () { + return new SQSMessageBinding(); + } + + public static SQSOperationBinding operationBinding () { + return new SQSOperationBinding(); + } + + public static SQSServerBinding serverBinding () { + return new SQSServerBinding(); + } + + @Nested + @DisplayName("channel") + class ChannelTest extends BindingTest {{ + super.binding = channelBinding(); + super.bindingTypeClass = SQSChannelBinding.class; + super.pathToBindingJson = "/bindings/default implementation/0.1.0/channel/binding.json"; + super.pathToExtendedBindingJson = "/bindings/default implementation/0.1.0/channel/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/default implementation/0.1.0/channel/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("message") + class Message extends BindingTest {{ + super.binding = messageBinding(); + super.bindingTypeClass = SQSMessageBinding.class; + super.pathToBindingJson = "/bindings/default implementation/0.1.0/message/binding.json"; + super.pathToExtendedBindingJson = "/bindings/default implementation/0.1.0/message/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/default implementation/0.1.0/message/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("operation") + class Operation extends BindingTest {{ + super.binding = operationBinding(); + super.bindingTypeClass = SQSOperationBinding.class; + super.pathToBindingJson = "/bindings/default implementation/0.1.0/operation/binding.json"; + super.pathToExtendedBindingJson = "/bindings/default implementation/0.1.0/operation/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/default implementation/0.1.0/operation/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("server") + class Server extends BindingTest {{ + super.binding = serverBinding(); + super.bindingTypeClass = SQSServerBinding.class; + super.pathToBindingJson = "/bindings/default implementation/0.1.0/server/binding.json"; + super.pathToExtendedBindingJson = "/bindings/default implementation/0.1.0/server/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/default implementation/0.1.0/server/binding - wrongly extended.json"; + }} + +} diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQSWithoutVersionTest.java b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQSWithoutVersionTest.java new file mode 100644 index 00000000..a5c1a445 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQSWithoutVersionTest.java @@ -0,0 +1,54 @@ +package com.asyncapi.bindings.sqs; + +import com.asyncapi.bindings.BindingTest; +import com.asyncapi.bindings.sqs.v0._1_0.channel.SQSChannelBinding; +import com.asyncapi.bindings.sqs.v0._1_0.message.SQSMessageBinding; +import com.asyncapi.bindings.sqs.v0._1_0.operation.SQSOperationBinding; +import com.asyncapi.bindings.sqs.v0._1_0.server.SQSServerBinding; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Nested; + +@DisplayName("without version") +public class SQSWithoutVersionTest { + + @Nested + @DisplayName("channel") + class ChannelTest extends BindingTest {{ + super.binding = SQSV0_1_0Test.channelBinding(); + super.bindingTypeClass = SQSChannelBinding.class; + super.pathToBindingJson = "/bindings/default implementation/without version/channel/binding.json"; + super.pathToExtendedBindingJson = "/bindings/default implementation/without version/channel/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/default implementation/without version/channel/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("message") + class Message extends BindingTest {{ + super.binding = SQSV0_1_0Test.messageBinding(); + super.bindingTypeClass = SQSMessageBinding.class; + super.pathToBindingJson = "/bindings/default implementation/without version/message/binding.json"; + super.pathToExtendedBindingJson = "/bindings/default implementation/without version/message/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/default implementation/without version/message/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("operation") + class Operation extends BindingTest {{ + super.binding = SQSV0_1_0Test.operationBinding(); + super.bindingTypeClass = SQSOperationBinding.class; + super.pathToBindingJson = "/bindings/default implementation/without version/operation/binding.json"; + super.pathToExtendedBindingJson = "/bindings/default implementation/without version/operation/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/default implementation/without version/operation/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("server") + class Server extends BindingTest {{ + super.binding = SQSV0_1_0Test.serverBinding(); + super.bindingTypeClass = SQSServerBinding.class; + super.pathToBindingJson = "/bindings/default implementation/without version/server/binding.json"; + super.pathToExtendedBindingJson = "/bindings/default implementation/without version/server/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/default implementation/without version/server/binding - wrongly extended.json"; + }} + +} diff --git a/asyncapi-core/src/test/resources/json/v2/2.0.0/model/asyncapi - extended.json b/asyncapi-core/src/test/resources/json/v2/2.0.0/model/asyncapi - extended.json index 2a8c4988..035156e1 100644 --- a/asyncapi-core/src/test/resources/json/v2/2.0.0/model/asyncapi - extended.json +++ b/asyncapi-core/src/test/resources/json/v2/2.0.0/model/asyncapi - extended.json @@ -100,7 +100,9 @@ "bindingVersion" : "0.3.0", "msgVpn" : "solace.private.net" }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -229,7 +231,9 @@ } } ] }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -355,7 +359,9 @@ } } ] }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -484,7 +490,9 @@ } } ] }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -610,7 +618,9 @@ } } ] }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -744,7 +754,9 @@ }, "sns" : { }, "solace" : { }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -880,7 +892,9 @@ }, "sns" : { }, "solace" : { }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -1065,7 +1079,9 @@ }, "sns" : { }, "solace" : { }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -1322,7 +1338,9 @@ } } ] }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -1447,7 +1465,9 @@ }, "sns" : { }, "solace" : { }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -1535,7 +1555,9 @@ "bindingVersion" : "0.3.0", "msgVpn" : "solace.private.net" }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -1643,7 +1665,9 @@ }, "sns" : { }, "solace" : { }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -1770,7 +1794,9 @@ } } ] }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -1857,7 +1883,9 @@ }, "sns" : { }, "solace" : { }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, diff --git a/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/channelItem - extended.json b/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/channelItem - extended.json index 2d5e47bf..e8579878 100644 --- a/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/channelItem - extended.json +++ b/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/channelItem - extended.json @@ -116,7 +116,9 @@ } } ] }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -242,7 +244,9 @@ } } ] }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -371,7 +375,9 @@ } } ] }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -497,7 +503,9 @@ } } ] }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -631,7 +639,9 @@ }, "sns" : { }, "solace" : { }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -767,7 +777,9 @@ }, "sns" : { }, "solace" : { }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, diff --git a/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/message/message - extended.json b/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/message/message - extended.json index 723de7cc..e1edcba2 100644 --- a/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/message/message - extended.json +++ b/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/message/message - extended.json @@ -123,7 +123,9 @@ }, "sns" : { }, "solace" : { }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, diff --git a/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/message/messageTrait - extended.json b/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/message/messageTrait - extended.json index 1ca796fa..5168a295 100644 --- a/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/message/messageTrait - extended.json +++ b/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/message/messageTrait - extended.json @@ -112,7 +112,9 @@ }, "sns" : { }, "solace" : { }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, diff --git a/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/operation/operation with message - extended.json b/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/operation/operation with message - extended.json index ee9af628..07269a93 100644 --- a/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/operation/operation with message - extended.json +++ b/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/operation/operation with message - extended.json @@ -114,7 +114,9 @@ } } ] }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -240,7 +242,9 @@ } } ] }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -374,7 +378,9 @@ }, "sns" : { }, "solace" : { }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, diff --git a/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/operation/operation with reference to message - extended.json b/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/operation/operation with reference to message - extended.json index f042d720..b50d9d12 100644 --- a/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/operation/operation with reference to message - extended.json +++ b/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/operation/operation with reference to message - extended.json @@ -114,7 +114,9 @@ } } ] }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -240,7 +242,9 @@ } } ] }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, diff --git a/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/operation/operationTrait - extended.json b/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/operation/operationTrait - extended.json index 76c89de9..d3fe0a51 100644 --- a/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/operation/operationTrait - extended.json +++ b/asyncapi-core/src/test/resources/json/v2/2.0.0/model/channel/operation/operationTrait - extended.json @@ -114,7 +114,9 @@ } } ] }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, diff --git a/asyncapi-core/src/test/resources/json/v2/2.0.0/model/components/components - extended.json b/asyncapi-core/src/test/resources/json/v2/2.0.0/model/components/components - extended.json index 57f2904d..6f5f8a77 100644 --- a/asyncapi-core/src/test/resources/json/v2/2.0.0/model/components/components - extended.json +++ b/asyncapi-core/src/test/resources/json/v2/2.0.0/model/components/components - extended.json @@ -154,7 +154,9 @@ }, "sns" : { }, "solace" : { }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -411,7 +413,9 @@ } } ] }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -536,7 +540,9 @@ }, "sns" : { }, "solace" : { }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -624,7 +630,9 @@ "bindingVersion" : "0.3.0", "msgVpn" : "solace.private.net" }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -732,7 +740,9 @@ }, "sns" : { }, "solace" : { }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -859,7 +869,9 @@ } } ] }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -946,7 +958,9 @@ }, "sns" : { }, "solace" : { }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, diff --git a/asyncapi-core/src/test/resources/json/v2/2.0.0/model/server/server - extended.json b/asyncapi-core/src/test/resources/json/v2/2.0.0/model/server/server - extended.json index de061ec3..1c9f2b27 100644 --- a/asyncapi-core/src/test/resources/json/v2/2.0.0/model/server/server - extended.json +++ b/asyncapi-core/src/test/resources/json/v2/2.0.0/model/server/server - extended.json @@ -80,7 +80,9 @@ "bindingVersion" : "0.3.0", "msgVpn" : "solace.private.net" }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, diff --git a/asyncapi-core/src/test/resources/json/v2/2.6.0/model/asyncapi - extended.json b/asyncapi-core/src/test/resources/json/v2/2.6.0/model/asyncapi - extended.json index 3718c9cb..27bf17c8 100644 --- a/asyncapi-core/src/test/resources/json/v2/2.6.0/model/asyncapi - extended.json +++ b/asyncapi-core/src/test/resources/json/v2/2.6.0/model/asyncapi - extended.json @@ -109,7 +109,9 @@ "bindingVersion" : "0.3.0", "msgVpn" : "solace.private.net" }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -1266,7 +1268,9 @@ "bindingVersion" : "0.3.0", "msgVpn" : "solace.private.net" }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -2956,7 +2960,9 @@ "bindingVersion" : "0.3.0", "msgVpn" : "solace.private.net" }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, diff --git a/asyncapi-core/src/test/resources/json/v2/2.6.0/model/components/components - extended.json b/asyncapi-core/src/test/resources/json/v2/2.6.0/model/components/components - extended.json index 77b9dc0d..7edd8f43 100644 --- a/asyncapi-core/src/test/resources/json/v2/2.6.0/model/components/components - extended.json +++ b/asyncapi-core/src/test/resources/json/v2/2.6.0/model/components/components - extended.json @@ -121,7 +121,9 @@ "bindingVersion" : "0.3.0", "msgVpn" : "solace.private.net" }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -1811,7 +1813,9 @@ "bindingVersion" : "0.3.0", "msgVpn" : "solace.private.net" }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, diff --git a/asyncapi-core/src/test/resources/json/v2/2.6.0/model/server/server - extended.json b/asyncapi-core/src/test/resources/json/v2/2.6.0/model/server/server - extended.json index 921af807..fc3f4597 100644 --- a/asyncapi-core/src/test/resources/json/v2/2.6.0/model/server/server - extended.json +++ b/asyncapi-core/src/test/resources/json/v2/2.6.0/model/server/server - extended.json @@ -90,7 +90,9 @@ "bindingVersion" : "0.3.0", "msgVpn" : "solace.private.net" }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, diff --git a/asyncapi-core/src/test/resources/json/v3/3.0.0/model/asyncapi - extended.json b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/asyncapi - extended.json index 5b49bc37..1d9c713e 100644 --- a/asyncapi-core/src/test/resources/json/v3/3.0.0/model/asyncapi - extended.json +++ b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/asyncapi - extended.json @@ -136,7 +136,9 @@ "bindingVersion" : "0.3.0", "msgVpn" : "solace.private.net" }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -254,7 +256,9 @@ "bindingVersion" : "0.3.0", "msgVpn" : "solace.private.net" }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -5154,7 +5158,9 @@ "bindingVersion" : "0.3.0", "msgVpn" : "solace.private.net" }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -12619,7 +12625,9 @@ "bindingVersion" : "0.3.0", "msgVpn" : "solace.private.net" }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, diff --git a/asyncapi-core/src/test/resources/json/v3/3.0.0/model/components/components - extended.json b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/components/components - extended.json index ea87c302..f458158d 100644 --- a/asyncapi-core/src/test/resources/json/v3/3.0.0/model/components/components - extended.json +++ b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/components/components - extended.json @@ -138,7 +138,9 @@ "bindingVersion" : "0.3.0", "msgVpn" : "solace.private.net" }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, @@ -7603,7 +7605,9 @@ "bindingVersion" : "0.3.0", "msgVpn" : "solace.private.net" }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, diff --git a/asyncapi-core/src/test/resources/json/v3/3.0.0/model/server/server - extended.json b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/server/server - extended.json index 7792b7bb..5b1ca31f 100644 --- a/asyncapi-core/src/test/resources/json/v3/3.0.0/model/server/server - extended.json +++ b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/server/server - extended.json @@ -104,7 +104,9 @@ "bindingVersion" : "0.3.0", "msgVpn" : "solace.private.net" }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" }, diff --git a/asyncapi-core/src/test/resources/json/v3/3.0.0/model/server/server with reference - extended.json b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/server/server with reference - extended.json index 0c6eb07f..0dd5c791 100644 --- a/asyncapi-core/src/test/resources/json/v3/3.0.0/model/server/server with reference - extended.json +++ b/asyncapi-core/src/test/resources/json/v3/3.0.0/model/server/server with reference - extended.json @@ -107,7 +107,9 @@ "bindingVersion" : "0.3.0", "msgVpn" : "solace.private.net" }, - "sqs" : { }, + "sqs" : { + "bindingVersion" : "0.1.0" + }, "stomp" : { "bindingVersion" : "0.1.0" },