Skip to content

Commit

Permalink
feat(bindings): SNS 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakisan committed Apr 30, 2024
1 parent 5d767df commit d203d00
Show file tree
Hide file tree
Showing 33 changed files with 581 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.asyncapi.bindings.nats.NATSChannelBinding;
import com.asyncapi.bindings.pulsar.PulsarChannelBinding;
import com.asyncapi.bindings.redis.RedisChannelBinding;
import com.asyncapi.bindings.sns.v0._1_0.channel.SNSChannelBinding;
import com.asyncapi.bindings.sns.SNSChannelBinding;
import com.asyncapi.bindings.solace.v0._3_0.channel.SolaceChannelBinding;
import com.asyncapi.bindings.sqs.SQSChannelBinding;
import com.asyncapi.bindings.stomp.STOMPChannelBinding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.asyncapi.bindings.nats.NATSMessageBinding;
import com.asyncapi.bindings.pulsar.PulsarMessageBinding;
import com.asyncapi.bindings.redis.RedisMessageBinding;
import com.asyncapi.bindings.sns.v0._1_0.message.SNSMessageBinding;
import com.asyncapi.bindings.sns.SNSMessageBinding;
import com.asyncapi.bindings.solace.v0._3_0.message.SolaceMessageBinding;
import com.asyncapi.bindings.sqs.SQSMessageBinding;
import com.asyncapi.bindings.stomp.STOMPMessageBinding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.asyncapi.bindings.nats.NATSOperationBinding;
import com.asyncapi.bindings.pulsar.PulsarOperationBinding;
import com.asyncapi.bindings.redis.RedisOperationBinding;
import com.asyncapi.bindings.sns.v0._1_0.operation.SNSOperationBinding;
import com.asyncapi.bindings.sns.SNSOperationBinding;
import com.asyncapi.bindings.solace.v0._3_0.operation.SolaceOperationBinding;
import com.asyncapi.bindings.sqs.SQSOperationBinding;
import com.asyncapi.bindings.stomp.STOMPOperationBinding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.asyncapi.bindings.nats.NATSServerBinding;
import com.asyncapi.bindings.pulsar.PulsarServerBinding;
import com.asyncapi.bindings.redis.RedisServerBinding;
import com.asyncapi.bindings.sns.v0._1_0.server.SNSServerBinding;
import com.asyncapi.bindings.sns.SNSServerBinding;
import com.asyncapi.bindings.solace.v0._3_0.server.SolaceServerBinding;
import com.asyncapi.bindings.sqs.SQSServerBinding;
import com.asyncapi.bindings.stomp.STOMPServerBinding;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.asyncapi.bindings.sns;

import com.asyncapi.bindings.ChannelBinding;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
* <p>
* Describes SNS channel binding.
*
* @version 0.1.0
* @see <a href="https://github.com/asyncapi/bindings/tree/master/sns#channel-binding-object">SNS channel binding</a>
* @author Pavel Bodiachevskii
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
defaultImpl = com.asyncapi.bindings.sns.v0._1_0.channel.SNSChannelBinding.class,
property = "bindingVersion",
visible = true
)
@JsonSubTypes({
@JsonSubTypes.Type(value = com.asyncapi.bindings.sns.v0._1_0.channel.SNSChannelBinding.class, names = {
"0.1.0",
"latest"
}),
})
@Data
@EqualsAndHashCode(callSuper = true)
public abstract class SNSChannelBinding extends ChannelBinding {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.asyncapi.bindings.sns;

import com.asyncapi.bindings.MessageBinding;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
* <p>
* Describes SNS message binding.
*
* @version 0.1.0
* @see <a href="https://github.com/asyncapi/bindings/tree/master/sns#message-binding-object">SNS message binding</a>
* @author Pavel Bodiachevskii
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
defaultImpl = com.asyncapi.bindings.sns.v0._1_0.message.SNSMessageBinding.class,
property = "bindingVersion",
visible = true
)
@JsonSubTypes({
@JsonSubTypes.Type(value = com.asyncapi.bindings.sns.v0._1_0.message.SNSMessageBinding.class, names = {
"0.1.0",
"latest"
}),
})
@Data
@EqualsAndHashCode(callSuper = true)
public abstract class SNSMessageBinding extends MessageBinding {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.asyncapi.bindings.sns;

import com.asyncapi.bindings.OperationBinding;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
* <p>
* Describes SNS operation binding.
*
* @version 0.1.0
* @see <a href="https://github.com/asyncapi/bindings/tree/master/sns#operation-binding-object">SNS operation binding</a>
* @author Pavel Bodiachevskii
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
defaultImpl = com.asyncapi.bindings.sns.v0._1_0.operation.SNSOperationBinding.class,
property = "bindingVersion",
visible = true
)
@JsonSubTypes({
@JsonSubTypes.Type(value = com.asyncapi.bindings.sns.v0._1_0.operation.SNSOperationBinding.class, names = {
"0.1.0",
"latest"
}),
})
@Data
@EqualsAndHashCode(callSuper = true)
public abstract class SNSOperationBinding extends OperationBinding {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.asyncapi.bindings.sns;

import com.asyncapi.bindings.ServerBinding;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
* <p>
* Describes SNS server binding.
*
* @version 0.1.0
* @see <a href="https://github.com/asyncapi/bindings/tree/master/sns#server-binding-object">SNS server binding</a>
* @author Pavel Bodiachevskii
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
defaultImpl = com.asyncapi.bindings.sns.v0._1_0.server.SNSServerBinding.class,
property = "bindingVersion",
visible = true
)
@JsonSubTypes({
@JsonSubTypes.Type(value = com.asyncapi.bindings.sns.v0._1_0.server.SNSServerBinding.class, names = {
"0.1.0",
"latest"
}),
})
@Data
@EqualsAndHashCode(callSuper = true)
public abstract class SNSServerBinding extends ServerBinding {}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.asyncapi.bindings.sns.v0._1_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.
Expand All @@ -17,5 +17,16 @@
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class SNSChannelBinding extends ChannelBinding {
public class SNSChannelBinding extends com.asyncapi.bindings.sns.SNSChannelBinding {

@Override
public String getBindingVersion() {
return "0.1.0";
}

@Override
public void setBindingVersion(@Nullable String bindingVersion) {
super.setBindingVersion("0.1.0");
}

}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.asyncapi.bindings.sns.v0._1_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.
Expand All @@ -17,5 +17,16 @@
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class SNSMessageBinding extends MessageBinding {
public class SNSMessageBinding extends com.asyncapi.bindings.sns.SNSMessageBinding {

@Override
public String getBindingVersion() {
return "0.1.0";
}

@Override
public void setBindingVersion(@Nullable String bindingVersion) {
super.setBindingVersion("0.1.0");
}

}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.asyncapi.bindings.sns.v0._1_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.
Expand All @@ -17,5 +17,16 @@
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class SNSOperationBinding extends OperationBinding {
public class SNSOperationBinding extends com.asyncapi.bindings.sns.SNSOperationBinding {

@Override
public String getBindingVersion() {
return "0.1.0";
}

@Override
public void setBindingVersion(@Nullable String bindingVersion) {
super.setBindingVersion("0.1.0");
}

}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.asyncapi.bindings.sns.v0._1_0.server;

import com.asyncapi.bindings.ServerBinding;
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.
Expand All @@ -17,5 +17,16 @@
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class SNSServerBinding extends ServerBinding {
public class SNSServerBinding extends com.asyncapi.bindings.sns.SNSServerBinding {

@Override
public String getBindingVersion() {
return "0.1.0";
}

@Override
public void setBindingVersion(@Nullable String bindingVersion) {
super.setBindingVersion("0.1.0");
}

}
11 changes: 11 additions & 0 deletions asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sns/SNS.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.asyncapi.bindings.sns;

import org.junit.platform.suite.api.SelectPackages;
import org.junit.platform.suite.api.Suite;
import org.junit.platform.suite.api.SuiteDisplayName;

@Suite
@SuiteDisplayName("SNS")
@SelectPackages("com.asyncapi.bindings.sns")
public class SNS {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.asyncapi.bindings.sns;

import com.asyncapi.bindings.BindingTest;
import com.asyncapi.bindings.sns.v0._1_0.channel.SNSChannelBinding;
import com.asyncapi.bindings.sns.v0._1_0.message.SNSMessageBinding;
import com.asyncapi.bindings.sns.v0._1_0.operation.SNSOperationBinding;
import com.asyncapi.bindings.sns.v0._1_0.server.SNSServerBinding;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;

@DisplayName("latest")
public class SNSLatestTest {

@Nested
@DisplayName("channel")
class ChannelTest extends BindingTest<SNSChannelBinding> {{
super.binding = SNSV0_1_0Test.channelBinding();
super.bindingTypeClass = SNSChannelBinding.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<SNSMessageBinding> {{
super.binding = SNSV0_1_0Test.messageBinding();
super.bindingTypeClass = SNSMessageBinding.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<SNSOperationBinding> {{
super.binding = SNSV0_1_0Test.operationBinding();
super.bindingTypeClass = SNSOperationBinding.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<SNSServerBinding> {{
super.binding = SNSV0_1_0Test.serverBinding();
super.bindingTypeClass = SNSServerBinding.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";
}}

}
Loading

0 comments on commit d203d00

Please sign in to comment.