Skip to content

Commit

Permalink
tests(bindings): SQS 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakisan committed Apr 29, 2024
1 parent a38bb80 commit 1383ad7
Show file tree
Hide file tree
Showing 29 changed files with 577 additions and 54 deletions.
Original file line number Diff line number Diff line change
@@ -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 <b>MUST NOT</b> contain any properties.
* <p>
* Its name is reserved for future use.
* <p>
* Describes SQS channel binding.
*
* @version 0.1.0
* @see <a href="https://github.com/asyncapi/bindings/tree/master/sqs#channel-binding-object">SQS channel binding</a>
* @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 {}
Original file line number Diff line number Diff line change
@@ -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 <b>MUST NOT</b> contain any properties.
* <p>
* Its name is reserved for future use.
* <p>
* Describes SQS message binding.
*
* @version 0.1.0
* @see <a href="https://github.com/asyncapi/bindings/tree/master/sqs#message-binding-object">SQS message binding</a>
* @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 {}
Original file line number Diff line number Diff line change
@@ -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 <b>MUST NOT</b> contain any properties.
* <p>
* Its name is reserved for future use.
* <p>
* Describes SQS operation binding.
*
* @version 0.1.0
* @see <a href="https://github.com/asyncapi/bindings/tree/master/sqs#operation-binding-object">SQS operation binding</a>
* @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 {}
Original file line number Diff line number Diff line change
@@ -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 <b>MUST NOT</b> contain any properties.
* <p>
* Its name is reserved for future use.
* <p>
* Describes SQS server binding.
*
* @version 0.1.0
* @see <a href="https://github.com/asyncapi/bindings/tree/master/sqs#server-binding-object">SQS server binding</a>
* @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 {}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.jetbrains.annotations.Nullable;

/**
* This class <b>MUST NOT</b> contain any properties.
Expand All @@ -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");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.jetbrains.annotations.Nullable;

/**
* This class <b>MUST NOT</b> contain any properties.
Expand All @@ -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");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.jetbrains.annotations.Nullable;

/**
* This class <b>MUST NOT</b> contain any properties.
Expand All @@ -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");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.jetbrains.annotations.Nullable;

/**
* This class <b>MUST NOT</b> contain any properties.
Expand All @@ -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");
}

}
11 changes: 11 additions & 0 deletions asyncapi-core/src/test/kotlin/com/asyncapi/bindings/sqs/SQS.java
Original file line number Diff line number Diff line change
@@ -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 {
}
Original file line number Diff line number Diff line change
@@ -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<SQSChannelBinding> {{
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<SQSMessageBinding> {{
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<SQSOperationBinding> {{
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<SQSServerBinding> {{
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";
}}

}
Original file line number Diff line number Diff line change
@@ -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<SQSChannelBinding> {{
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<SQSMessageBinding> {{
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<SQSOperationBinding> {{
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<SQSServerBinding> {{
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";
}}

}
Loading

0 comments on commit 1383ad7

Please sign in to comment.