Skip to content

Commit

Permalink
feat(bindings): STOMP 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakisan committed Apr 24, 2024
1 parent d29ad69 commit f72a2f0
Show file tree
Hide file tree
Showing 91 changed files with 1,449 additions and 58 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.asyncapi.bindings.stomp;

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

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

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

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

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

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

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

/**
* This class <b>MUST NOT</b> contain any properties.
* <p>
* Its name is reserved for future use.
* <p>
* Describes STOMP server binding.
*
* @version 0.1.0
* @see <a href="https://github.com/asyncapi/bindings/tree/master/sqs#server-binding-object">STOMP server binding</a>
* @author Pavel Bodiachevskii
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
defaultImpl = com.asyncapi.bindings.stomp.v0._1_0.server.STOMPServerBinding.class,
property = "bindingVersion",
visible = true
)
@JsonSubTypes({
@JsonSubTypes.Type(value = com.asyncapi.bindings.stomp.v0._1_0.server.STOMPServerBinding.class, names = {
"0.1.0",
"latest"
}),
})
@Data
@EqualsAndHashCode(callSuper = true)
public abstract class STOMPServerBinding 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 @@ -17,7 +18,21 @@
* @author Pavel Bodiachevskii
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class STOMPChannelBinding extends ChannelBinding {
public class STOMPChannelBinding extends com.asyncapi.bindings.stomp.STOMPChannelBinding {

public STOMPChannelBinding() {
this.setBindingVersion("0.1.0");
}

@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 @@ -17,7 +18,21 @@
* @author Pavel Bodiachevskii
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class STOMPMessageBinding extends MessageBinding {
public class STOMPMessageBinding extends com.asyncapi.bindings.stomp.STOMPMessageBinding {

public STOMPMessageBinding() {
this.setBindingVersion("0.1.0");
}

@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 @@ -17,7 +18,21 @@
* @author Pavel Bodiachevskii
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class STOMPOperationBinding extends OperationBinding {
public class STOMPOperationBinding extends com.asyncapi.bindings.stomp.STOMPOperationBinding {

public STOMPOperationBinding() {
this.setBindingVersion("0.1.0");
}

@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 @@ -17,7 +18,21 @@
* @author Pavel Bodiachevskii
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class STOMPServerBinding extends ServerBinding {
public class STOMPServerBinding extends com.asyncapi.bindings.stomp.STOMPServerBinding {

public STOMPServerBinding() {
this.setBindingVersion("0.1.0");
}

@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,12 +1,17 @@
package com.asyncapi.bindings;

import com.asyncapi.bindings.stomp.STOMPTest;
import com.asyncapi.bindings.websockets.WebSocketsTest;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;

@DisplayName("Bindings")
public class BindingsTest {

@Nested
@DisplayName("STOMP")
class STOMP extends STOMPTest {}

@Nested
@DisplayName("WebSockets")
class WebSockets extends WebSocketsTest {}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
package com.asyncapi.bindings.stomp;

import com.asyncapi.bindings.stomp._1_0.channel.STOMPChannelBindingTest;
import com.asyncapi.bindings.stomp._1_0.message.STOMPMessageBindingTest;
import com.asyncapi.bindings.stomp._1_0.operation.STOMPOperationBindingTest;
import com.asyncapi.bindings.stomp._1_0.server.STOMPServerBindingTest;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;

public abstract class STOMPTest {

@Nested
@DisplayName("unknown version")
class UnknownVersion {

@Nested
@DisplayName("channel")
class Channel extends com.asyncapi.bindings.stomp.latest.channel.STOMPChannelBindingTest {}

@Nested
@DisplayName("message")
class Message extends com.asyncapi.bindings.stomp.latest.message.STOMPMessageBindingTest {}

@Nested
@DisplayName("operation")
class Operation extends com.asyncapi.bindings.stomp.latest.operation.STOMPOperationBindingTest {}

@Nested
@DisplayName("server")
class Server extends com.asyncapi.bindings.stomp.latest.server.STOMPServerBindingTest {}

}

@Nested
@DisplayName("without version")
class WithoutVersion {

@Nested
@DisplayName("channel")
class Channel extends com.asyncapi.bindings.stomp.withoutversion.channel.STOMPChannelBindingTest {}

@Nested
@DisplayName("message")
class Message extends com.asyncapi.bindings.stomp.withoutversion.message.STOMPMessageBindingTest {}

@Nested
@DisplayName("operation")
class Operation extends com.asyncapi.bindings.stomp.withoutversion.operation.STOMPOperationBindingTest {}

@Nested
@DisplayName("server")
class Server extends com.asyncapi.bindings.stomp.withoutversion.server.STOMPServerBindingTest {}

}

@Nested
@DisplayName("latest")
class Latest {

@Nested
@DisplayName("channel")
class Channel extends com.asyncapi.bindings.stomp.latest.channel.STOMPChannelBindingTest {}

@Nested
@DisplayName("message")
class Message extends com.asyncapi.bindings.stomp.latest.message.STOMPMessageBindingTest {}

@Nested
@DisplayName("operation")
class Operation extends com.asyncapi.bindings.stomp.latest.operation.STOMPOperationBindingTest {}

@Nested
@DisplayName("server")
class Server extends com.asyncapi.bindings.stomp.latest.server.STOMPServerBindingTest {}

}

@Nested
@DisplayName("0.1.0")
class V0_1_0 {

@Nested
@DisplayName("channel")
class Channel extends STOMPChannelBindingTest {}

@Nested
@DisplayName("message")
class Message extends STOMPMessageBindingTest {}

@Nested
@DisplayName("operation")
class Operation extends STOMPOperationBindingTest {}

@Nested
@DisplayName("server")
class Server extends STOMPServerBindingTest {}

}

}
Loading

0 comments on commit f72a2f0

Please sign in to comment.