diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/ChannelBindingsDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/ChannelBindingsDeserializer.java index 7f089304..56c75198 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/bindings/ChannelBindingsDeserializer.java +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/ChannelBindingsDeserializer.java @@ -10,7 +10,7 @@ import com.asyncapi.bindings.kafka.KafkaChannelBinding; import com.asyncapi.bindings.mercure.MercureChannelBinding; import com.asyncapi.bindings.mqtt.v0._1_0.channel.MQTTChannelBinding; -import com.asyncapi.bindings.mqtt5.v0._2_0.channel.MQTT5ChannelBinding; +import com.asyncapi.bindings.mqtt5.MQTT5ChannelBinding; import com.asyncapi.bindings.nats.NATSChannelBinding; import com.asyncapi.bindings.pulsar.PulsarChannelBinding; import com.asyncapi.bindings.redis.RedisChannelBinding; diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/MessageBindingsDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/MessageBindingsDeserializer.java index 7f3704d6..be2ce0cd 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/bindings/MessageBindingsDeserializer.java +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/MessageBindingsDeserializer.java @@ -10,7 +10,7 @@ import com.asyncapi.bindings.kafka.KafkaMessageBinding; import com.asyncapi.bindings.mercure.MercureMessageBinding; import com.asyncapi.bindings.mqtt.v0._1_0.message.MQTTMessageBinding; -import com.asyncapi.bindings.mqtt5.v0._2_0.message.MQTT5MessageBinding; +import com.asyncapi.bindings.mqtt5.MQTT5MessageBinding; import com.asyncapi.bindings.nats.NATSMessageBinding; import com.asyncapi.bindings.pulsar.PulsarMessageBinding; import com.asyncapi.bindings.redis.RedisMessageBinding; diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/OperationBindingsDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/OperationBindingsDeserializer.java index d9fba36d..391e294e 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/bindings/OperationBindingsDeserializer.java +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/OperationBindingsDeserializer.java @@ -10,7 +10,7 @@ import com.asyncapi.bindings.kafka.KafkaOperationBinding; import com.asyncapi.bindings.mercure.MercureOperationBinding; import com.asyncapi.bindings.mqtt.v0._1_0.operation.MQTTOperationBinding; -import com.asyncapi.bindings.mqtt5.v0._2_0.operation.MQTT5OperationBinding; +import com.asyncapi.bindings.mqtt5.MQTT5OperationBinding; import com.asyncapi.bindings.nats.NATSOperationBinding; import com.asyncapi.bindings.pulsar.PulsarOperationBinding; import com.asyncapi.bindings.redis.RedisOperationBinding; diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/ServerBindingsDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/ServerBindingsDeserializer.java index e79911b5..71f75aef 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/bindings/ServerBindingsDeserializer.java +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/ServerBindingsDeserializer.java @@ -10,7 +10,7 @@ import com.asyncapi.bindings.kafka.KafkaServerBinding; import com.asyncapi.bindings.mercure.MercureServerBinding; import com.asyncapi.bindings.mqtt.v0._1_0.server.MQTTServerBinding; -import com.asyncapi.bindings.mqtt5.v0._2_0.server.MQTT5ServerBinding; +import com.asyncapi.bindings.mqtt5.MQTT5ServerBinding; import com.asyncapi.bindings.nats.NATSServerBinding; import com.asyncapi.bindings.pulsar.PulsarServerBinding; import com.asyncapi.bindings.redis.RedisServerBinding; diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/MQTT5ChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/MQTT5ChannelBinding.java new file mode 100644 index 00000000..00d631ed --- /dev/null +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/MQTT5ChannelBinding.java @@ -0,0 +1,31 @@ +package com.asyncapi.bindings.mqtt5; + +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 MQTT 5 channel binding. + * + * @version 0.2.0 + * @see MQTT 5 channel binding + * @author Pavel Bodiachevskii + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.EXISTING_PROPERTY, + defaultImpl = com.asyncapi.bindings.mqtt5.v0._2_0.channel.MQTT5ChannelBinding.class, + property = "bindingVersion", + visible = true +) +@JsonSubTypes({ + @JsonSubTypes.Type(value = com.asyncapi.bindings.mqtt5.v0._2_0.channel.MQTT5ChannelBinding.class, names = { + "0.2.0", + "latest" + }), +}) +@EqualsAndHashCode(callSuper = true) +public abstract class MQTT5ChannelBinding extends ChannelBinding {} \ No newline at end of file diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/MQTT5MessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/MQTT5MessageBinding.java new file mode 100644 index 00000000..b83f565b --- /dev/null +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/MQTT5MessageBinding.java @@ -0,0 +1,31 @@ +package com.asyncapi.bindings.mqtt5; + +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 MQTT 5 message binding. + * + * @version 0.2.0 + * @see MQTT 5 message binding + * @author Pavel Bodiachevskii + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.EXISTING_PROPERTY, + defaultImpl = com.asyncapi.bindings.mqtt5.v0._2_0.message.MQTT5MessageBinding.class, + property = "bindingVersion", + visible = true +) +@JsonSubTypes({ + @JsonSubTypes.Type(value = com.asyncapi.bindings.mqtt5.v0._2_0.message.MQTT5MessageBinding.class, names = { + "0.2.0", + "latest" + }), +}) +@EqualsAndHashCode(callSuper = true) +public abstract class MQTT5MessageBinding extends MessageBinding {} \ No newline at end of file diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/MQTT5OperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/MQTT5OperationBinding.java new file mode 100644 index 00000000..b58b3c1a --- /dev/null +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/MQTT5OperationBinding.java @@ -0,0 +1,31 @@ +package com.asyncapi.bindings.mqtt5; + +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 MQTT 5 operation binding. + * + * @version 0.2.0 + * @see MQTT 5 operation binding + * @author Pavel Bodiachevskii + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.EXISTING_PROPERTY, + defaultImpl = com.asyncapi.bindings.mqtt5.v0._2_0.operation.MQTT5OperationBinding.class, + property = "bindingVersion", + visible = true +) +@JsonSubTypes({ + @JsonSubTypes.Type(value = com.asyncapi.bindings.mqtt5.v0._2_0.operation.MQTT5OperationBinding.class, names = { + "0.2.0", + "latest" + }), +}) +@EqualsAndHashCode(callSuper = true) +public abstract class MQTT5OperationBinding extends OperationBinding {} \ No newline at end of file diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/MQTT5ServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/MQTT5ServerBinding.java new file mode 100644 index 00000000..6a8cf52b --- /dev/null +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/MQTT5ServerBinding.java @@ -0,0 +1,29 @@ +package com.asyncapi.bindings.mqtt5; + +import com.asyncapi.bindings.ServerBinding; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import lombok.EqualsAndHashCode; + +/** + * Describes MQTT 5 server binding. + * + * @version 0.2.0 + * @see MQTT 5 server binding + * @author Pavel Bodiachevskii + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.EXISTING_PROPERTY, + defaultImpl = com.asyncapi.bindings.mqtt5.v0._2_0.server.MQTT5ServerBinding.class, + property = "bindingVersion", + visible = true +) +@JsonSubTypes({ + @JsonSubTypes.Type(value = com.asyncapi.bindings.mqtt5.v0._2_0.server.MQTT5ServerBinding.class, names = { + "0.2.0", + "latest" + }), +}) +@EqualsAndHashCode(callSuper = true) +public abstract class MQTT5ServerBinding extends ServerBinding {} \ No newline at end of file diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/v0/_2_0/channel/MQTT5ChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/v0/_2_0/channel/MQTT5ChannelBinding.java index 0e8ce3e0..97b4eb0f 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/v0/_2_0/channel/MQTT5ChannelBinding.java +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/v0/_2_0/channel/MQTT5ChannelBinding.java @@ -1,9 +1,9 @@ package com.asyncapi.bindings.mqtt5.v0._2_0.channel; -import com.asyncapi.bindings.ChannelBinding; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import org.jetbrains.annotations.Nullable; /** * This class MUST NOT contain any properties. Its name is reserved for future use. @@ -17,5 +17,16 @@ @Data @NoArgsConstructor @EqualsAndHashCode(callSuper = true) -public class MQTT5ChannelBinding extends ChannelBinding { +public class MQTT5ChannelBinding extends com.asyncapi.bindings.mqtt5.MQTT5ChannelBinding { + + @Override + public String getBindingVersion() { + return "0.2.0"; + } + + @Override + public void setBindingVersion(@Nullable String bindingVersion) { + super.setBindingVersion("0.2.0"); + } + } diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/v0/_2_0/message/MQTT5MessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/v0/_2_0/message/MQTT5MessageBinding.java index 39161990..9b5ead5f 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/v0/_2_0/message/MQTT5MessageBinding.java +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/v0/_2_0/message/MQTT5MessageBinding.java @@ -1,9 +1,9 @@ package com.asyncapi.bindings.mqtt5.v0._2_0.message; -import com.asyncapi.bindings.MessageBinding; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import org.jetbrains.annotations.Nullable; /** * This class MUST NOT contain any properties. Its name is reserved for future use. @@ -17,5 +17,16 @@ @Data @NoArgsConstructor @EqualsAndHashCode(callSuper = true) -public class MQTT5MessageBinding extends MessageBinding { +public class MQTT5MessageBinding extends com.asyncapi.bindings.mqtt5.MQTT5MessageBinding { + + @Override + public String getBindingVersion() { + return "0.2.0"; + } + + @Override + public void setBindingVersion(@Nullable String bindingVersion) { + super.setBindingVersion("0.2.0"); + } + } diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/v0/_2_0/operation/MQTT5OperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/v0/_2_0/operation/MQTT5OperationBinding.java index 9f74ddc2..77a272db 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/v0/_2_0/operation/MQTT5OperationBinding.java +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/v0/_2_0/operation/MQTT5OperationBinding.java @@ -1,9 +1,9 @@ package com.asyncapi.bindings.mqtt5.v0._2_0.operation; -import com.asyncapi.bindings.OperationBinding; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import org.jetbrains.annotations.Nullable; /** * This class MUST NOT contain any properties. Its name is reserved for future use. @@ -17,5 +17,16 @@ @Data @NoArgsConstructor @EqualsAndHashCode(callSuper = true) -public class MQTT5OperationBinding extends OperationBinding { +public class MQTT5OperationBinding extends com.asyncapi.bindings.mqtt5.MQTT5OperationBinding { + + @Override + public String getBindingVersion() { + return "0.2.0"; + } + + @Override + public void setBindingVersion(@Nullable String bindingVersion) { + super.setBindingVersion("0.2.0"); + } + } diff --git a/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/v0/_2_0/server/MQTT5ServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/v0/_2_0/server/MQTT5ServerBinding.java index d3a27b87..3701febd 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/v0/_2_0/server/MQTT5ServerBinding.java +++ b/asyncapi-core/src/main/java/com/asyncapi/bindings/mqtt5/v0/_2_0/server/MQTT5ServerBinding.java @@ -1,7 +1,7 @@ package com.asyncapi.bindings.mqtt5.v0._2_0.server; -import com.asyncapi.bindings.ServerBinding; import lombok.*; +import org.jetbrains.annotations.Nullable; /** * Describes MQTT 5 server binding. @@ -15,7 +15,7 @@ @NoArgsConstructor @AllArgsConstructor @EqualsAndHashCode(callSuper = true) -public class MQTT5ServerBinding extends ServerBinding { +public class MQTT5ServerBinding extends com.asyncapi.bindings.mqtt5.MQTT5ServerBinding { /** * TODO: support reference, Schema object @@ -23,7 +23,14 @@ public class MQTT5ServerBinding extends ServerBinding { */ private int sessionExpiryInterval; - @Builder.Default - private String bindingVersion = "0.2.0"; + @Override + public String getBindingVersion() { + return "0.2.0"; + } + + @Override + public void setBindingVersion(@Nullable String bindingVersion) { + super.setBindingVersion("0.2.0"); + } } diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt/MQTT.java b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt/MQTT.java index 21785200..b271656f 100644 --- a/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt/MQTT.java +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt/MQTT.java @@ -5,7 +5,7 @@ import org.junit.platform.suite.api.SuiteDisplayName; @Suite -@SuiteDisplayName("MQTT") +@SuiteDisplayName("MQTT5") @SelectPackages("com.asyncapi.bindings.mqtt") public class MQTT { } diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt5/MQTT5.java b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt5/MQTT5.java new file mode 100644 index 00000000..d8fb0ab7 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt5/MQTT5.java @@ -0,0 +1,11 @@ +package com.asyncapi.bindings.mqtt5; + +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; +import org.junit.platform.suite.api.SuiteDisplayName; + +@Suite +@SuiteDisplayName("MQTT5") +@SelectPackages("com.asyncapi.bindings.mqtt5") +public class MQTT5 { +} diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt5/MQTT5LatestTest.java b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt5/MQTT5LatestTest.java new file mode 100644 index 00000000..9efb892e --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt5/MQTT5LatestTest.java @@ -0,0 +1,54 @@ +package com.asyncapi.bindings.mqtt5; + +import com.asyncapi.bindings.BindingTest; +import com.asyncapi.bindings.mqtt5.v0._2_0.channel.MQTT5ChannelBinding; +import com.asyncapi.bindings.mqtt5.v0._2_0.message.MQTT5MessageBinding; +import com.asyncapi.bindings.mqtt5.v0._2_0.operation.MQTT5OperationBinding; +import com.asyncapi.bindings.mqtt5.v0._2_0.server.MQTT5ServerBinding; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Nested; + +@DisplayName("latest") +public class MQTT5LatestTest { + + @Nested + @DisplayName("channel") + class ChannelTest extends BindingTest {{ + super.binding = MQTT5V0_2_0Test.channelBinding(); + super.bindingTypeClass = MQTT5ChannelBinding.class; + super.pathToBindingJson = "/bindings/mqtt5/latest/channel/binding.json"; + super.pathToExtendedBindingJson = "/bindings/mqtt5/latest/channel/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/mqtt5/latest/channel/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("message") + class Message extends BindingTest {{ + super.binding = MQTT5V0_2_0Test.messageBinding(); + super.bindingTypeClass = MQTT5MessageBinding.class; + super.pathToBindingJson = "/bindings/mqtt5/latest/message/binding.json"; + super.pathToExtendedBindingJson = "/bindings/mqtt5/latest/message/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/mqtt5/latest/message/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("operation") + class Operation extends BindingTest {{ + super.binding = MQTT5V0_2_0Test.operationBinding(); + super.bindingTypeClass = MQTT5OperationBinding.class; + super.pathToBindingJson = "/bindings/mqtt5/latest/operation/binding.json"; + super.pathToExtendedBindingJson = "/bindings/mqtt5/latest/operation/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/mqtt5/latest/operation/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("server") + class Server extends BindingTest {{ + super.binding = MQTT5V0_2_0Test.serverBinding(); + super.bindingTypeClass = MQTT5ServerBinding.class; + super.pathToBindingJson = "/bindings/mqtt5/latest/server/binding.json"; + super.pathToExtendedBindingJson = "/bindings/mqtt5/latest/server/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/mqtt5/latest/server/binding - wrongly extended.json"; + }} + +} diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt5/MQTT5UnknownVersionTest.java b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt5/MQTT5UnknownVersionTest.java new file mode 100644 index 00000000..e9b1c1d9 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt5/MQTT5UnknownVersionTest.java @@ -0,0 +1,54 @@ +package com.asyncapi.bindings.mqtt5; + +import com.asyncapi.bindings.BindingTest; +import com.asyncapi.bindings.mqtt5.v0._2_0.channel.MQTT5ChannelBinding; +import com.asyncapi.bindings.mqtt5.v0._2_0.message.MQTT5MessageBinding; +import com.asyncapi.bindings.mqtt5.v0._2_0.operation.MQTT5OperationBinding; +import com.asyncapi.bindings.mqtt5.v0._2_0.server.MQTT5ServerBinding; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Nested; + +@DisplayName("unknown version") +public class MQTT5UnknownVersionTest { + + @Nested + @DisplayName("channel") + class ChannelTest extends BindingTest {{ + super.binding = MQTT5V0_2_0Test.channelBinding(); + super.bindingTypeClass = MQTT5ChannelBinding.class; + super.pathToBindingJson = "/bindings/mqtt5/unknown version/channel/binding.json"; + super.pathToExtendedBindingJson = "/bindings/mqtt5/unknown version/channel/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/mqtt5/unknown version/channel/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("message") + class Message extends BindingTest {{ + super.binding = MQTT5V0_2_0Test.messageBinding(); + super.bindingTypeClass = MQTT5MessageBinding.class; + super.pathToBindingJson = "/bindings/mqtt5/unknown version/message/binding.json"; + super.pathToExtendedBindingJson = "/bindings/mqtt5/unknown version/message/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/mqtt5/unknown version/message/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("operation") + class Operation extends BindingTest {{ + super.binding = MQTT5V0_2_0Test.operationBinding(); + super.bindingTypeClass = MQTT5OperationBinding.class; + super.pathToBindingJson = "/bindings/mqtt5/unknown version/operation/binding.json"; + super.pathToExtendedBindingJson = "/bindings/mqtt5/unknown version/operation/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/mqtt5/unknown version/operation/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("server") + class Server extends BindingTest {{ + super.binding = MQTT5V0_2_0Test.serverBinding(); + super.bindingTypeClass = MQTT5ServerBinding.class; + super.pathToBindingJson = "/bindings/mqtt5/unknown version/server/binding.json"; + super.pathToExtendedBindingJson = "/bindings/mqtt5/unknown version/server/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/mqtt5/unknown version/server/binding - wrongly extended.json"; + }} + +} diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt5/MQTT5V0_2_0Test.java b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt5/MQTT5V0_2_0Test.java new file mode 100644 index 00000000..ecbf2216 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt5/MQTT5V0_2_0Test.java @@ -0,0 +1,72 @@ +package com.asyncapi.bindings.mqtt5; + +import com.asyncapi.bindings.BindingTest; +import com.asyncapi.bindings.mqtt5.v0._2_0.channel.MQTT5ChannelBinding; +import com.asyncapi.bindings.mqtt5.v0._2_0.message.MQTT5MessageBinding; +import com.asyncapi.bindings.mqtt5.v0._2_0.operation.MQTT5OperationBinding; +import com.asyncapi.bindings.mqtt5.v0._2_0.server.MQTT5ServerBinding; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Nested; + +@DisplayName("0.2.0") +public class MQTT5V0_2_0Test { + + public static MQTT5ChannelBinding channelBinding () { + return new MQTT5ChannelBinding(); + } + + public static MQTT5MessageBinding messageBinding () { + return new MQTT5MessageBinding(); + } + + public static MQTT5OperationBinding operationBinding () { + return new MQTT5OperationBinding(); + } + + public static MQTT5ServerBinding serverBinding () { + return MQTT5ServerBinding.builder() + .sessionExpiryInterval(60) + .build(); + } + + @Nested + @DisplayName("channel") + class ChannelTest extends BindingTest {{ + super.binding = channelBinding(); + super.bindingTypeClass = MQTT5ChannelBinding.class; + super.pathToBindingJson = "/bindings/mqtt5/0.2.0/channel/binding.json"; + super.pathToExtendedBindingJson = "/bindings/mqtt5/0.2.0/channel/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/mqtt5/0.2.0/channel/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("message") + class Message extends BindingTest {{ + super.binding = messageBinding(); + super.bindingTypeClass = MQTT5MessageBinding.class; + super.pathToBindingJson = "/bindings/mqtt5/0.2.0/message/binding.json"; + super.pathToExtendedBindingJson = "/bindings/mqtt5/0.2.0/message/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/mqtt5/0.2.0/message/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("operation") + class Operation extends BindingTest {{ + super.binding = operationBinding(); + super.bindingTypeClass = MQTT5OperationBinding.class; + super.pathToBindingJson = "/bindings/mqtt5/0.2.0/operation/binding.json"; + super.pathToExtendedBindingJson = "/bindings/mqtt5/0.2.0/operation/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/mqtt5/0.2.0/operation/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("server") + class Server extends BindingTest {{ + super.binding = serverBinding(); + super.bindingTypeClass = MQTT5ServerBinding.class; + super.pathToBindingJson = "/bindings/mqtt5/0.2.0/server/binding.json"; + super.pathToExtendedBindingJson = "/bindings/mqtt5/0.2.0/server/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/mqtt5/0.2.0/server/binding - wrongly extended.json"; + }} + +} diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt5/MQTT5WithoutVersionTest.java b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt5/MQTT5WithoutVersionTest.java new file mode 100644 index 00000000..e42c7e77 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt5/MQTT5WithoutVersionTest.java @@ -0,0 +1,54 @@ +package com.asyncapi.bindings.mqtt5; + +import com.asyncapi.bindings.BindingTest; +import com.asyncapi.bindings.mqtt5.v0._2_0.channel.MQTT5ChannelBinding; +import com.asyncapi.bindings.mqtt5.v0._2_0.message.MQTT5MessageBinding; +import com.asyncapi.bindings.mqtt5.v0._2_0.operation.MQTT5OperationBinding; +import com.asyncapi.bindings.mqtt5.v0._2_0.server.MQTT5ServerBinding; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Nested; + +@DisplayName("without version") +public class MQTT5WithoutVersionTest { + + @Nested + @DisplayName("channel") + class ChannelTest extends BindingTest {{ + super.binding = MQTT5V0_2_0Test.channelBinding(); + super.bindingTypeClass = MQTT5ChannelBinding.class; + super.pathToBindingJson = "/bindings/mqtt5/without version/channel/binding.json"; + super.pathToExtendedBindingJson = "/bindings/mqtt5/without version/channel/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/mqtt5/without version/channel/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("message") + class Message extends BindingTest {{ + super.binding = MQTT5V0_2_0Test.messageBinding(); + super.bindingTypeClass = MQTT5MessageBinding.class; + super.pathToBindingJson = "/bindings/mqtt5/without version/message/binding.json"; + super.pathToExtendedBindingJson = "/bindings/mqtt5/without version/message/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/mqtt5/without version/message/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("operation") + class Operation extends BindingTest {{ + super.binding = MQTT5V0_2_0Test.operationBinding(); + super.bindingTypeClass = MQTT5OperationBinding.class; + super.pathToBindingJson = "/bindings/mqtt5/without version/operation/binding.json"; + super.pathToExtendedBindingJson = "/bindings/mqtt5/without version/operation/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/mqtt5/without version/operation/binding - wrongly extended.json"; + }} + + @Nested + @DisplayName("server") + class Server extends BindingTest {{ + super.binding = MQTT5V0_2_0Test.serverBinding(); + super.bindingTypeClass = MQTT5ServerBinding.class; + super.pathToBindingJson = "/bindings/mqtt5/without version/server/binding.json"; + super.pathToExtendedBindingJson = "/bindings/mqtt5/without version/server/binding - extended.json"; + super.pathToWronglyExtendedBindingJson = "/bindings/mqtt5/without version/server/binding - wrongly extended.json"; + }} + +} diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt5/v0/_2_0/server/MQTT5ServerBindingTest.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt5/v0/_2_0/server/MQTT5ServerBindingTest.kt deleted file mode 100644 index d0251ec9..00000000 --- a/asyncapi-core/src/test/kotlin/com/asyncapi/bindings/mqtt5/v0/_2_0/server/MQTT5ServerBindingTest.kt +++ /dev/null @@ -1,25 +0,0 @@ -package com.asyncapi.bindings.mqtt5.v0._2_0.server - -import com.asyncapi.v3.SerDeTest - -/** - * @version 3.0.0 - * @author Pavel Bodiachevskii - */ -class MQTT5ServerBindingTest: SerDeTest() { - - override fun objectClass() = MQTT5ServerBinding::class.java - - override fun baseObjectJson() = "/bindings/mqtt5/server/mqtt5ServerBinding.json" - - override fun extendedObjectJson() = "/bindings/mqtt5/server/mqtt5ServerBinding - extended.json" - - override fun wronglyExtendedObjectJson() = "/bindings/mqtt5/server/mqtt5ServerBinding - wrongly extended.json" - - override fun build(): MQTT5ServerBinding { - return MQTT5ServerBinding.builder() - .sessionExpiryInterval(60) - .build() - } - -} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/channel/binding - extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/channel/binding - extended.json new file mode 100644 index 00000000..3e09b93f --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/channel/binding - extended.json @@ -0,0 +1,8 @@ +{ + "bindingVersion" : "0.2.0", + "x-number" : 0, + "x-string" : "", + "x-object" : { + "property" : { } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/channel/binding - wrongly extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/channel/binding - wrongly extended.json new file mode 100644 index 00000000..1cb38f9c --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/channel/binding - wrongly extended.json @@ -0,0 +1,9 @@ +{ + "bindingVersion": "0.2.0", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/channel/binding.json b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/channel/binding.json new file mode 100644 index 00000000..a22565a8 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/channel/binding.json @@ -0,0 +1,3 @@ +{ + "bindingVersion": "0.2.0" +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/message/binding - extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/message/binding - extended.json new file mode 100644 index 00000000..3e09b93f --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/message/binding - extended.json @@ -0,0 +1,8 @@ +{ + "bindingVersion" : "0.2.0", + "x-number" : 0, + "x-string" : "", + "x-object" : { + "property" : { } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/message/binding - wrongly extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/message/binding - wrongly extended.json new file mode 100644 index 00000000..1cb38f9c --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/message/binding - wrongly extended.json @@ -0,0 +1,9 @@ +{ + "bindingVersion": "0.2.0", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/message/binding.json b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/message/binding.json new file mode 100644 index 00000000..a22565a8 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/message/binding.json @@ -0,0 +1,3 @@ +{ + "bindingVersion": "0.2.0" +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/operation/binding - extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/operation/binding - extended.json new file mode 100644 index 00000000..3e09b93f --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/operation/binding - extended.json @@ -0,0 +1,8 @@ +{ + "bindingVersion" : "0.2.0", + "x-number" : 0, + "x-string" : "", + "x-object" : { + "property" : { } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/operation/binding - wrongly extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/operation/binding - wrongly extended.json new file mode 100644 index 00000000..1cb38f9c --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/operation/binding - wrongly extended.json @@ -0,0 +1,9 @@ +{ + "bindingVersion": "0.2.0", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/operation/binding.json b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/operation/binding.json new file mode 100644 index 00000000..a22565a8 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/operation/binding.json @@ -0,0 +1,3 @@ +{ + "bindingVersion": "0.2.0" +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/server/mqtt5ServerBinding - extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/server/binding - extended.json similarity index 100% rename from asyncapi-core/src/test/resources/bindings/mqtt5/server/mqtt5ServerBinding - extended.json rename to asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/server/binding - extended.json diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/server/mqtt5ServerBinding - wrongly extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/server/binding - wrongly extended.json similarity index 100% rename from asyncapi-core/src/test/resources/bindings/mqtt5/server/mqtt5ServerBinding - wrongly extended.json rename to asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/server/binding - wrongly extended.json diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/server/mqtt5ServerBinding.json b/asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/server/binding.json similarity index 100% rename from asyncapi-core/src/test/resources/bindings/mqtt5/server/mqtt5ServerBinding.json rename to asyncapi-core/src/test/resources/bindings/mqtt5/0.2.0/server/binding.json diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/latest/channel/binding - extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/channel/binding - extended.json new file mode 100644 index 00000000..3e09b93f --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/channel/binding - extended.json @@ -0,0 +1,8 @@ +{ + "bindingVersion" : "0.2.0", + "x-number" : 0, + "x-string" : "", + "x-object" : { + "property" : { } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/latest/channel/binding - wrongly extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/channel/binding - wrongly extended.json new file mode 100644 index 00000000..18560ee8 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/channel/binding - wrongly extended.json @@ -0,0 +1,9 @@ +{ + "bindingVersion": "latest", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/latest/channel/binding.json b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/channel/binding.json new file mode 100644 index 00000000..cdf165f6 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/channel/binding.json @@ -0,0 +1,3 @@ +{ + "bindingVersion": "latest" +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/latest/message/binding - extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/message/binding - extended.json new file mode 100644 index 00000000..3e09b93f --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/message/binding - extended.json @@ -0,0 +1,8 @@ +{ + "bindingVersion" : "0.2.0", + "x-number" : 0, + "x-string" : "", + "x-object" : { + "property" : { } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/latest/message/binding - wrongly extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/message/binding - wrongly extended.json new file mode 100644 index 00000000..18560ee8 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/message/binding - wrongly extended.json @@ -0,0 +1,9 @@ +{ + "bindingVersion": "latest", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/latest/message/binding.json b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/message/binding.json new file mode 100644 index 00000000..cdf165f6 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/message/binding.json @@ -0,0 +1,3 @@ +{ + "bindingVersion": "latest" +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/latest/operation/binding - extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/operation/binding - extended.json new file mode 100644 index 00000000..3e09b93f --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/operation/binding - extended.json @@ -0,0 +1,8 @@ +{ + "bindingVersion" : "0.2.0", + "x-number" : 0, + "x-string" : "", + "x-object" : { + "property" : { } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/latest/operation/binding - wrongly extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/operation/binding - wrongly extended.json new file mode 100644 index 00000000..18560ee8 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/operation/binding - wrongly extended.json @@ -0,0 +1,9 @@ +{ + "bindingVersion": "latest", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/latest/operation/binding.json b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/operation/binding.json new file mode 100644 index 00000000..cdf165f6 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/operation/binding.json @@ -0,0 +1,3 @@ +{ + "bindingVersion": "latest" +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/latest/server/binding - extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/server/binding - extended.json new file mode 100644 index 00000000..1104cd11 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/server/binding - extended.json @@ -0,0 +1,9 @@ +{ + "sessionExpiryInterval" : 60, + "bindingVersion" : "0.2.0", + "x-number" : 0, + "x-string" : "", + "x-object" : { + "property" : { } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/latest/server/binding - wrongly extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/server/binding - wrongly extended.json new file mode 100644 index 00000000..40808889 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/server/binding - wrongly extended.json @@ -0,0 +1,10 @@ +{ + "sessionExpiryInterval": 60, + "bindingVersion": "latest", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/latest/server/binding.json b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/server/binding.json new file mode 100644 index 00000000..e61cd53a --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/latest/server/binding.json @@ -0,0 +1,4 @@ +{ + "sessionExpiryInterval": 60, + "bindingVersion": "latest" +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/channel/binding - extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/channel/binding - extended.json new file mode 100644 index 00000000..3e09b93f --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/channel/binding - extended.json @@ -0,0 +1,8 @@ +{ + "bindingVersion" : "0.2.0", + "x-number" : 0, + "x-string" : "", + "x-object" : { + "property" : { } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/channel/binding - wrongly extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/channel/binding - wrongly extended.json new file mode 100644 index 00000000..0dee3264 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/channel/binding - wrongly extended.json @@ -0,0 +1,9 @@ +{ + "bindingVersion": "unknown version", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/channel/binding.json b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/channel/binding.json new file mode 100644 index 00000000..defc96bf --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/channel/binding.json @@ -0,0 +1,3 @@ +{ + "bindingVersion": "unknown version" +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/message/binding - extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/message/binding - extended.json new file mode 100644 index 00000000..3e09b93f --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/message/binding - extended.json @@ -0,0 +1,8 @@ +{ + "bindingVersion" : "0.2.0", + "x-number" : 0, + "x-string" : "", + "x-object" : { + "property" : { } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/message/binding - wrongly extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/message/binding - wrongly extended.json new file mode 100644 index 00000000..0dee3264 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/message/binding - wrongly extended.json @@ -0,0 +1,9 @@ +{ + "bindingVersion": "unknown version", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/message/binding.json b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/message/binding.json new file mode 100644 index 00000000..defc96bf --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/message/binding.json @@ -0,0 +1,3 @@ +{ + "bindingVersion": "unknown version" +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/operation/binding - extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/operation/binding - extended.json new file mode 100644 index 00000000..3e09b93f --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/operation/binding - extended.json @@ -0,0 +1,8 @@ +{ + "bindingVersion" : "0.2.0", + "x-number" : 0, + "x-string" : "", + "x-object" : { + "property" : { } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/operation/binding - wrongly extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/operation/binding - wrongly extended.json new file mode 100644 index 00000000..0dee3264 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/operation/binding - wrongly extended.json @@ -0,0 +1,9 @@ +{ + "bindingVersion": "unknown version", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/operation/binding.json b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/operation/binding.json new file mode 100644 index 00000000..defc96bf --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/operation/binding.json @@ -0,0 +1,3 @@ +{ + "bindingVersion": "unknown version" +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/server/binding - extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/server/binding - extended.json new file mode 100644 index 00000000..1104cd11 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/server/binding - extended.json @@ -0,0 +1,9 @@ +{ + "sessionExpiryInterval" : 60, + "bindingVersion" : "0.2.0", + "x-number" : 0, + "x-string" : "", + "x-object" : { + "property" : { } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/server/binding - wrongly extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/server/binding - wrongly extended.json new file mode 100644 index 00000000..97f17911 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/server/binding - wrongly extended.json @@ -0,0 +1,10 @@ +{ + "sessionExpiryInterval": 60, + "bindingVersion": "unknown version", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/server/binding.json b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/server/binding.json new file mode 100644 index 00000000..02fc5dc0 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/unknown version/server/binding.json @@ -0,0 +1,4 @@ +{ + "sessionExpiryInterval": 60, + "bindingVersion": "unknown version" +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/without version/channel/binding - extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/channel/binding - extended.json new file mode 100644 index 00000000..3e09b93f --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/channel/binding - extended.json @@ -0,0 +1,8 @@ +{ + "bindingVersion" : "0.2.0", + "x-number" : 0, + "x-string" : "", + "x-object" : { + "property" : { } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/without version/channel/binding - wrongly extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/channel/binding - wrongly extended.json new file mode 100644 index 00000000..0dee3264 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/channel/binding - wrongly extended.json @@ -0,0 +1,9 @@ +{ + "bindingVersion": "unknown version", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/without version/channel/binding.json b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/channel/binding.json new file mode 100644 index 00000000..defc96bf --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/channel/binding.json @@ -0,0 +1,3 @@ +{ + "bindingVersion": "unknown version" +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/without version/message/binding - extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/message/binding - extended.json new file mode 100644 index 00000000..3e09b93f --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/message/binding - extended.json @@ -0,0 +1,8 @@ +{ + "bindingVersion" : "0.2.0", + "x-number" : 0, + "x-string" : "", + "x-object" : { + "property" : { } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/without version/message/binding - wrongly extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/message/binding - wrongly extended.json new file mode 100644 index 00000000..0dee3264 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/message/binding - wrongly extended.json @@ -0,0 +1,9 @@ +{ + "bindingVersion": "unknown version", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/without version/message/binding.json b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/message/binding.json new file mode 100644 index 00000000..defc96bf --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/message/binding.json @@ -0,0 +1,3 @@ +{ + "bindingVersion": "unknown version" +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/without version/operation/binding - extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/operation/binding - extended.json new file mode 100644 index 00000000..3e09b93f --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/operation/binding - extended.json @@ -0,0 +1,8 @@ +{ + "bindingVersion" : "0.2.0", + "x-number" : 0, + "x-string" : "", + "x-object" : { + "property" : { } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/without version/operation/binding - wrongly extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/operation/binding - wrongly extended.json new file mode 100644 index 00000000..0dee3264 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/operation/binding - wrongly extended.json @@ -0,0 +1,9 @@ +{ + "bindingVersion": "unknown version", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/without version/operation/binding.json b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/operation/binding.json new file mode 100644 index 00000000..defc96bf --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/operation/binding.json @@ -0,0 +1,3 @@ +{ + "bindingVersion": "unknown version" +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/without version/server/binding - extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/server/binding - extended.json new file mode 100644 index 00000000..1104cd11 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/server/binding - extended.json @@ -0,0 +1,9 @@ +{ + "sessionExpiryInterval" : 60, + "bindingVersion" : "0.2.0", + "x-number" : 0, + "x-string" : "", + "x-object" : { + "property" : { } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/without version/server/binding - wrongly extended.json b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/server/binding - wrongly extended.json new file mode 100644 index 00000000..97f17911 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/server/binding - wrongly extended.json @@ -0,0 +1,10 @@ +{ + "sessionExpiryInterval": 60, + "bindingVersion": "unknown version", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/bindings/mqtt5/without version/server/binding.json b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/server/binding.json new file mode 100644 index 00000000..02fc5dc0 --- /dev/null +++ b/asyncapi-core/src/test/resources/bindings/mqtt5/without version/server/binding.json @@ -0,0 +1,4 @@ +{ + "sessionExpiryInterval": 60, + "bindingVersion": "unknown version" +} \ No newline at end of file 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 f1cb86be..279491f0 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 @@ -195,7 +195,9 @@ "qos" : 2, "retain" : true }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0", "queue" : "messages" @@ -323,7 +325,9 @@ "qos" : 2, "retain" : true }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0", "queue" : "messages" @@ -454,7 +458,9 @@ "qos" : 2, "retain" : true }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0", "queue" : "messages" @@ -582,7 +588,9 @@ "qos" : 2, "retain" : true }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0", "queue" : "messages" @@ -742,7 +750,9 @@ "mqtt" : { "bindingVersion" : "0.1.0" }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0" }, @@ -872,7 +882,9 @@ "mqtt" : { "bindingVersion" : "0.1.0" }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0" }, @@ -1069,7 +1081,9 @@ "mqtt" : { "bindingVersion" : "0.1.0" }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0" }, @@ -1304,7 +1318,9 @@ "qos" : 2, "retain" : true }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0", "queue" : "messages" @@ -1455,7 +1471,9 @@ "mqtt" : { "bindingVersion" : "0.1.0" }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0" }, @@ -1647,7 +1665,9 @@ "mqtt" : { "bindingVersion" : "0.1.0" }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0" }, @@ -1762,7 +1782,9 @@ "qos" : 2, "retain" : true }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0", "queue" : "messages" @@ -1875,7 +1897,9 @@ "mqtt" : { "bindingVersion" : "0.1.0" }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "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 86c04a6c..f7ac405c 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 @@ -80,7 +80,9 @@ "qos" : 2, "retain" : true }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0", "queue" : "messages" @@ -208,7 +210,9 @@ "qos" : 2, "retain" : true }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0", "queue" : "messages" @@ -339,7 +343,9 @@ "qos" : 2, "retain" : true }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0", "queue" : "messages" @@ -467,7 +473,9 @@ "qos" : 2, "retain" : true }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0", "queue" : "messages" @@ -627,7 +635,9 @@ "mqtt" : { "bindingVersion" : "0.1.0" }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0" }, @@ -757,7 +767,9 @@ "mqtt" : { "bindingVersion" : "0.1.0" }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "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 e1edcba2..9378615c 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 @@ -111,7 +111,9 @@ "mqtt" : { "bindingVersion" : "0.1.0" }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "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 5168a295..d1c7b79d 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 @@ -100,7 +100,9 @@ "mqtt" : { "bindingVersion" : "0.1.0" }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "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 07269a93..5ea63791 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 @@ -78,7 +78,9 @@ "qos" : 2, "retain" : true }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0", "queue" : "messages" @@ -206,7 +208,9 @@ "qos" : 2, "retain" : true }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0", "queue" : "messages" @@ -366,7 +370,9 @@ "mqtt" : { "bindingVersion" : "0.1.0" }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "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 b50d9d12..30cb28a8 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 @@ -78,7 +78,9 @@ "qos" : 2, "retain" : true }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0", "queue" : "messages" @@ -206,7 +208,9 @@ "qos" : 2, "retain" : true }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0", "queue" : "messages" 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 d3fe0a51..60d8522a 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 @@ -78,7 +78,9 @@ "qos" : 2, "retain" : true }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0", "queue" : "messages" 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 80ec285e..16fa40ed 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 @@ -142,7 +142,9 @@ "mqtt" : { "bindingVersion" : "0.1.0" }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0" }, @@ -377,7 +379,9 @@ "qos" : 2, "retain" : true }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0", "queue" : "messages" @@ -528,7 +532,9 @@ "mqtt" : { "bindingVersion" : "0.1.0" }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0" }, @@ -720,7 +726,9 @@ "mqtt" : { "bindingVersion" : "0.1.0" }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0" }, @@ -835,7 +843,9 @@ "qos" : 2, "retain" : true }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0", "queue" : "messages" @@ -948,7 +958,9 @@ "mqtt" : { "bindingVersion" : "0.1.0" }, - "mqtt5" : { }, + "mqtt5" : { + "bindingVersion" : "0.2.0" + }, "nats" : { "bindingVersion" : "0.1.0" },