diff --git a/test/v2/issues/135/asyncapi.gen.go b/test/v2/issues/135/asyncapi.gen.go index 02284aa0..0983fff2 100644 --- a/test/v2/issues/135/asyncapi.gen.go +++ b/test/v2/issues/135/asyncapi.gen.go @@ -67,21 +67,21 @@ func (e *Error) Error() string { return fmt.Sprintf("channel %q: err %v", e.Channel, e.Err) } -// GroupMessage is the message expected for 'GroupMessage' channel. -type GroupMessage struct { +// V2Issue135GroupMessage is the message expected for 'V2Issue135GroupMessage' channel. +type V2Issue135GroupMessage struct { // Payload will be inserted in the message payload Payload string } -func NewGroupMessage() GroupMessage { - var msg GroupMessage +func NewV2Issue135GroupMessage() V2Issue135GroupMessage { + var msg V2Issue135GroupMessage return msg } -// brokerMessageToGroupMessage will fill a new GroupMessage with data from generic broker message -func brokerMessageToGroupMessage(bMsg extensions.BrokerMessage) (GroupMessage, error) { - var msg GroupMessage +// brokerMessageToV2Issue135GroupMessage will fill a new V2Issue135GroupMessage with data from generic broker message +func brokerMessageToV2Issue135GroupMessage(bMsg extensions.BrokerMessage) (V2Issue135GroupMessage, error) { + var msg V2Issue135GroupMessage // Convert to string payload := string(bMsg.Payload) @@ -92,8 +92,8 @@ func brokerMessageToGroupMessage(bMsg extensions.BrokerMessage) (GroupMessage, e return msg, nil } -// toBrokerMessage will generate a generic broker message from GroupMessage data -func (msg GroupMessage) toBrokerMessage() (extensions.BrokerMessage, error) { +// toBrokerMessage will generate a generic broker message from V2Issue135GroupMessage data +func (msg V2Issue135GroupMessage) toBrokerMessage() (extensions.BrokerMessage, error) { // TODO: implement checks on message // Convert to []byte @@ -108,21 +108,21 @@ func (msg GroupMessage) toBrokerMessage() (extensions.BrokerMessage, error) { }, nil } -// InfoMessage is the message expected for 'InfoMessage' channel. -type InfoMessage struct { +// V2Issue135InfoMessage is the message expected for 'V2Issue135InfoMessage' channel. +type V2Issue135InfoMessage struct { // Payload will be inserted in the message payload Payload string } -func NewInfoMessage() InfoMessage { - var msg InfoMessage +func NewV2Issue135InfoMessage() V2Issue135InfoMessage { + var msg V2Issue135InfoMessage return msg } -// brokerMessageToInfoMessage will fill a new InfoMessage with data from generic broker message -func brokerMessageToInfoMessage(bMsg extensions.BrokerMessage) (InfoMessage, error) { - var msg InfoMessage +// brokerMessageToV2Issue135InfoMessage will fill a new V2Issue135InfoMessage with data from generic broker message +func brokerMessageToV2Issue135InfoMessage(bMsg extensions.BrokerMessage) (V2Issue135InfoMessage, error) { + var msg V2Issue135InfoMessage // Convert to string payload := string(bMsg.Payload) @@ -133,8 +133,8 @@ func brokerMessageToInfoMessage(bMsg extensions.BrokerMessage) (InfoMessage, err return msg, nil } -// toBrokerMessage will generate a generic broker message from InfoMessage data -func (msg InfoMessage) toBrokerMessage() (extensions.BrokerMessage, error) { +// toBrokerMessage will generate a generic broker message from V2Issue135InfoMessage data +func (msg V2Issue135InfoMessage) toBrokerMessage() (extensions.BrokerMessage, error) { // TODO: implement checks on message // Convert to []byte @@ -149,21 +149,21 @@ func (msg InfoMessage) toBrokerMessage() (extensions.BrokerMessage, error) { }, nil } -// ProjectMessage is the message expected for 'ProjectMessage' channel. -type ProjectMessage struct { +// V2Issue135ProjectMessage is the message expected for 'V2Issue135ProjectMessage' channel. +type V2Issue135ProjectMessage struct { // Payload will be inserted in the message payload Payload string } -func NewProjectMessage() ProjectMessage { - var msg ProjectMessage +func NewV2Issue135ProjectMessage() V2Issue135ProjectMessage { + var msg V2Issue135ProjectMessage return msg } -// brokerMessageToProjectMessage will fill a new ProjectMessage with data from generic broker message -func brokerMessageToProjectMessage(bMsg extensions.BrokerMessage) (ProjectMessage, error) { - var msg ProjectMessage +// brokerMessageToV2Issue135ProjectMessage will fill a new V2Issue135ProjectMessage with data from generic broker message +func brokerMessageToV2Issue135ProjectMessage(bMsg extensions.BrokerMessage) (V2Issue135ProjectMessage, error) { + var msg V2Issue135ProjectMessage // Convert to string payload := string(bMsg.Payload) @@ -174,8 +174,8 @@ func brokerMessageToProjectMessage(bMsg extensions.BrokerMessage) (ProjectMessag return msg, nil } -// toBrokerMessage will generate a generic broker message from ProjectMessage data -func (msg ProjectMessage) toBrokerMessage() (extensions.BrokerMessage, error) { +// toBrokerMessage will generate a generic broker message from V2Issue135ProjectMessage data +func (msg V2Issue135ProjectMessage) toBrokerMessage() (extensions.BrokerMessage, error) { // TODO: implement checks on message // Convert to []byte @@ -190,21 +190,21 @@ func (msg ProjectMessage) toBrokerMessage() (extensions.BrokerMessage, error) { }, nil } -// ResourceMessage is the message expected for 'ResourceMessage' channel. -type ResourceMessage struct { +// V2Issue135ResourceMessage is the message expected for 'V2Issue135ResourceMessage' channel. +type V2Issue135ResourceMessage struct { // Payload will be inserted in the message payload Payload string } -func NewResourceMessage() ResourceMessage { - var msg ResourceMessage +func NewV2Issue135ResourceMessage() V2Issue135ResourceMessage { + var msg V2Issue135ResourceMessage return msg } -// brokerMessageToResourceMessage will fill a new ResourceMessage with data from generic broker message -func brokerMessageToResourceMessage(bMsg extensions.BrokerMessage) (ResourceMessage, error) { - var msg ResourceMessage +// brokerMessageToV2Issue135ResourceMessage will fill a new V2Issue135ResourceMessage with data from generic broker message +func brokerMessageToV2Issue135ResourceMessage(bMsg extensions.BrokerMessage) (V2Issue135ResourceMessage, error) { + var msg V2Issue135ResourceMessage // Convert to string payload := string(bMsg.Payload) @@ -215,8 +215,8 @@ func brokerMessageToResourceMessage(bMsg extensions.BrokerMessage) (ResourceMess return msg, nil } -// toBrokerMessage will generate a generic broker message from ResourceMessage data -func (msg ResourceMessage) toBrokerMessage() (extensions.BrokerMessage, error) { +// toBrokerMessage will generate a generic broker message from V2Issue135ResourceMessage data +func (msg V2Issue135ResourceMessage) toBrokerMessage() (extensions.BrokerMessage, error) { // TODO: implement checks on message // Convert to []byte @@ -231,21 +231,21 @@ func (msg ResourceMessage) toBrokerMessage() (extensions.BrokerMessage, error) { }, nil } -// StatusMessage is the message expected for 'StatusMessage' channel. -type StatusMessage struct { +// V2Issue135StatusMessage is the message expected for 'V2Issue135StatusMessage' channel. +type V2Issue135StatusMessage struct { // Payload will be inserted in the message payload Payload string } -func NewStatusMessage() StatusMessage { - var msg StatusMessage +func NewV2Issue135StatusMessage() V2Issue135StatusMessage { + var msg V2Issue135StatusMessage return msg } -// brokerMessageToStatusMessage will fill a new StatusMessage with data from generic broker message -func brokerMessageToStatusMessage(bMsg extensions.BrokerMessage) (StatusMessage, error) { - var msg StatusMessage +// brokerMessageToV2Issue135StatusMessage will fill a new V2Issue135StatusMessage with data from generic broker message +func brokerMessageToV2Issue135StatusMessage(bMsg extensions.BrokerMessage) (V2Issue135StatusMessage, error) { + var msg V2Issue135StatusMessage // Convert to string payload := string(bMsg.Payload) @@ -256,8 +256,8 @@ func brokerMessageToStatusMessage(bMsg extensions.BrokerMessage) (StatusMessage, return msg, nil } -// toBrokerMessage will generate a generic broker message from StatusMessage data -func (msg StatusMessage) toBrokerMessage() (extensions.BrokerMessage, error) { +// toBrokerMessage will generate a generic broker message from V2Issue135StatusMessage data +func (msg V2Issue135StatusMessage) toBrokerMessage() (extensions.BrokerMessage, error) { // TODO: implement checks on message // Convert to []byte @@ -273,23 +273,23 @@ func (msg StatusMessage) toBrokerMessage() (extensions.BrokerMessage, error) { } const ( - // GroupPath is the constant representing the 'Group' channel path. - GroupPath = "group" - // InfoPath is the constant representing the 'Info' channel path. - InfoPath = "info" - // ProjectPath is the constant representing the 'Project' channel path. - ProjectPath = "project" - // ResourcePath is the constant representing the 'Resource' channel path. - ResourcePath = "resource" - // StatusPath is the constant representing the 'Status' channel path. - StatusPath = "status" + // V2Issue135GroupPath is the constant representing the 'V2Issue135Group' channel path. + V2Issue135GroupPath = "v2.issue135.group" + // V2Issue135InfoPath is the constant representing the 'V2Issue135Info' channel path. + V2Issue135InfoPath = "v2.issue135.info" + // V2Issue135ProjectPath is the constant representing the 'V2Issue135Project' channel path. + V2Issue135ProjectPath = "v2.issue135.project" + // V2Issue135ResourcePath is the constant representing the 'V2Issue135Resource' channel path. + V2Issue135ResourcePath = "v2.issue135.resource" + // V2Issue135StatusPath is the constant representing the 'V2Issue135Status' channel path. + V2Issue135StatusPath = "v2.issue135.status" ) // ChannelsPaths is an array of all channels paths var ChannelsPaths = []string{ - GroupPath, - InfoPath, - ProjectPath, - ResourcePath, - StatusPath, + V2Issue135GroupPath, + V2Issue135InfoPath, + V2Issue135ProjectPath, + V2Issue135ResourcePath, + V2Issue135StatusPath, } diff --git a/test/v2/issues/135/asyncapi.yaml b/test/v2/issues/135/asyncapi.yaml index 1ece7fa1..e32ce356 100644 --- a/test/v2/issues/135/asyncapi.yaml +++ b/test/v2/issues/135/asyncapi.yaml @@ -9,27 +9,27 @@ info: title: Sample App version: 1.2.3 channels: - resource: + v2.issue135.resource: publish: message: payload: type: string - info: + v2.issue135.info: publish: message: payload: type: string - status: + v2.issue135.status: subscribe: message: payload: type: string - project: + v2.issue135.project: publish: message: payload: type: string - group: + v2.issue135.group: publish: message: payload: diff --git a/test/v2/issues/135/suite_test.go b/test/v2/issues/135/suite_test.go index ea098bd0..072f7e1a 100644 --- a/test/v2/issues/135/suite_test.go +++ b/test/v2/issues/135/suite_test.go @@ -18,20 +18,20 @@ type Suite struct { func (suite *Suite) TestCheckPaths() { // Check path contents - suite.Require().Equal("group", GroupPath) - suite.Require().Equal("info", InfoPath) - suite.Require().Equal("project", ProjectPath) - suite.Require().Equal("resource", ResourcePath) - suite.Require().Equal("status", StatusPath) + suite.Require().Equal("v2.issue135.group", V2Issue135GroupPath) + suite.Require().Equal("v2.issue135.info", V2Issue135InfoPath) + suite.Require().Equal("v2.issue135.project", V2Issue135ProjectPath) + suite.Require().Equal("v2.issue135.resource", V2Issue135ResourcePath) + suite.Require().Equal("v2.issue135.status", V2Issue135StatusPath) // Check path list for _, p := range ChannelsPaths { switch p { - case GroupPath: - case InfoPath: - case ProjectPath: - case ResourcePath: - case StatusPath: + case V2Issue135GroupPath: + case V2Issue135InfoPath: + case V2Issue135ProjectPath: + case V2Issue135ResourcePath: + case V2Issue135StatusPath: default: suite.Require().Fail("unknown channel path", p) } diff --git a/test/v2/issues/169/asyncapi.gen.go b/test/v2/issues/169/asyncapi.gen.go index c13e1b3d..b7bccfef 100644 --- a/test/v2/issues/169/asyncapi.gen.go +++ b/test/v2/issues/169/asyncapi.gen.go @@ -12,8 +12,8 @@ import ( // AppSubscriber represents all handlers that are expecting messages for App type AppSubscriber interface { - // Issue169Msg subscribes to messages placed on the 'issue169.msg' channel - Issue169Msg(ctx context.Context, msg Issue169MsgMessage) error + // V2Issue169Msg subscribes to messages placed on the 'v2.issue169.msg' channel + V2Issue169Msg(ctx context.Context, msg V2Issue169MsgMessage) error } // AppController is the structure that provides publishing capabilities to the @@ -124,7 +124,7 @@ func (c *AppController) SubscribeAll(ctx context.Context, as AppSubscriber) erro return extensions.ErrNilAppSubscriber } - if err := c.SubscribeIssue169Msg(ctx, as.Issue169Msg); err != nil { + if err := c.SubscribeV2Issue169Msg(ctx, as.V2Issue169Msg); err != nil { return err } @@ -133,18 +133,18 @@ func (c *AppController) SubscribeAll(ctx context.Context, as AppSubscriber) erro // UnsubscribeAll will unsubscribe all remaining subscribed channels func (c *AppController) UnsubscribeAll(ctx context.Context) { - c.UnsubscribeIssue169Msg(ctx) + c.UnsubscribeV2Issue169Msg(ctx) } -// SubscribeIssue169Msg will subscribe to new messages from 'issue169.msg' channel. +// SubscribeV2Issue169Msg will subscribe to new messages from 'v2.issue169.msg' channel. // // Callback function 'fn' will be called each time a new message is received. -func (c *AppController) SubscribeIssue169Msg( +func (c *AppController) SubscribeV2Issue169Msg( ctx context.Context, - fn func(ctx context.Context, msg Issue169MsgMessage) error, + fn func(ctx context.Context, msg V2Issue169MsgMessage) error, ) error { // Get channel path - path := "issue169.msg" + path := "v2.issue169.msg" // Set context ctx = addAppContextValues(ctx, path) @@ -184,7 +184,7 @@ func (c *AppController) SubscribeIssue169Msg( // Execute middlewares before handling the message if err := c.executeMiddlewares(ctx, &acknowledgeableBrokerMessage.BrokerMessage, func(ctx context.Context) error { // Process message - msg, err := brokerMessageToIssue169MsgMessage(acknowledgeableBrokerMessage.BrokerMessage) + msg, err := brokerMessageToV2Issue169MsgMessage(acknowledgeableBrokerMessage.BrokerMessage) if err != nil { return err } @@ -212,11 +212,11 @@ func (c *AppController) SubscribeIssue169Msg( return nil } -// UnsubscribeIssue169Msg will unsubscribe messages from 'issue169.msg' channel. +// UnsubscribeV2Issue169Msg will unsubscribe messages from 'v2.issue169.msg' channel. // A timeout can be set in context to avoid blocking operation, if needed. -func (c *AppController) UnsubscribeIssue169Msg(ctx context.Context) { +func (c *AppController) UnsubscribeV2Issue169Msg(ctx context.Context) { // Get channel path - path := "issue169.msg" + path := "v2.issue169.msg" // Check if there subscribers for this channel sub, exists := c.subscriptions[path] @@ -334,13 +334,13 @@ func (c *UserController) Close(ctx context.Context) { // Unsubscribing remaining channels } -// PublishIssue169Msg will publish messages to 'issue169.msg' channel -func (c *UserController) PublishIssue169Msg( +// PublishV2Issue169Msg will publish messages to 'v2.issue169.msg' channel +func (c *UserController) PublishV2Issue169Msg( ctx context.Context, - msg Issue169MsgMessage, + msg V2Issue169MsgMessage, ) error { // Get channel path - path := "issue169.msg" + path := "v2.issue169.msg" // Set context ctx = addUserContextValues(ctx, path) @@ -419,21 +419,21 @@ func (e *Error) Error() string { return fmt.Sprintf("channel %q: err %v", e.Channel, e.Err) } -// Issue169MsgMessage is the message expected for 'Issue169MsgMessage' channel. -type Issue169MsgMessage struct { +// V2Issue169MsgMessage is the message expected for 'V2Issue169MsgMessage' channel. +type V2Issue169MsgMessage struct { // Payload will be inserted in the message payload Payload string } -func NewIssue169MsgMessage() Issue169MsgMessage { - var msg Issue169MsgMessage +func NewV2Issue169MsgMessage() V2Issue169MsgMessage { + var msg V2Issue169MsgMessage return msg } -// brokerMessageToIssue169MsgMessage will fill a new Issue169MsgMessage with data from generic broker message -func brokerMessageToIssue169MsgMessage(bMsg extensions.BrokerMessage) (Issue169MsgMessage, error) { - var msg Issue169MsgMessage +// brokerMessageToV2Issue169MsgMessage will fill a new V2Issue169MsgMessage with data from generic broker message +func brokerMessageToV2Issue169MsgMessage(bMsg extensions.BrokerMessage) (V2Issue169MsgMessage, error) { + var msg V2Issue169MsgMessage // Convert to string payload := string(bMsg.Payload) @@ -444,8 +444,8 @@ func brokerMessageToIssue169MsgMessage(bMsg extensions.BrokerMessage) (Issue169M return msg, nil } -// toBrokerMessage will generate a generic broker message from Issue169MsgMessage data -func (msg Issue169MsgMessage) toBrokerMessage() (extensions.BrokerMessage, error) { +// toBrokerMessage will generate a generic broker message from V2Issue169MsgMessage data +func (msg V2Issue169MsgMessage) toBrokerMessage() (extensions.BrokerMessage, error) { // TODO: implement checks on message // Convert to []byte @@ -461,11 +461,11 @@ func (msg Issue169MsgMessage) toBrokerMessage() (extensions.BrokerMessage, error } const ( - // Issue169MsgPath is the constant representing the 'Issue169Msg' channel path. - Issue169MsgPath = "issue169.msg" + // V2Issue169MsgPath is the constant representing the 'V2Issue169Msg' channel path. + V2Issue169MsgPath = "v2.issue169.msg" ) // ChannelsPaths is an array of all channels paths var ChannelsPaths = []string{ - Issue169MsgPath, + V2Issue169MsgPath, } diff --git a/test/v2/issues/169/asyncapi.yaml b/test/v2/issues/169/asyncapi.yaml index 5757c2a8..a23ce0e5 100644 --- a/test/v2/issues/169/asyncapi.yaml +++ b/test/v2/issues/169/asyncapi.yaml @@ -7,7 +7,7 @@ info: title: Sample App version: 1.0.0 channels: - issue169.msg: + v2.issue169.msg: publish: message: payload: diff --git a/test/v2/issues/169/suite_test.go b/test/v2/issues/169/suite_test.go index 85fe7d75..9d8710a4 100644 --- a/test/v2/issues/169/suite_test.go +++ b/test/v2/issues/169/suite_test.go @@ -114,23 +114,23 @@ func (suite *Suite) TestIssue169() { var wg sync.WaitGroup // Test message - sent := Issue169MsgMessage{ + sent := V2Issue169MsgMessage{ Payload: "some test msg", } // Validate msg - err := suite.app.SubscribeIssue169Msg(context.Background(), - func(ctx context.Context, msg Issue169MsgMessage) error { + err := suite.app.SubscribeV2Issue169Msg(context.Background(), + func(ctx context.Context, msg V2Issue169MsgMessage) error { suite.Require().Equal(sent.Payload, msg.Payload) wg.Done() return nil }) suite.Require().NoError(err) - defer suite.app.UnsubscribeIssue169Msg(context.Background()) + defer suite.app.UnsubscribeV2Issue169Msg(context.Background()) // Publish the message wg.Add(1) - err = suite.user.PublishIssue169Msg(context.Background(), sent) + err = suite.user.PublishV2Issue169Msg(context.Background(), sent) suite.Require().NoError(err) wg.Wait() diff --git a/test/v2/issues/190/asyncapi.gen.go b/test/v2/issues/190/asyncapi.gen.go index 71ade5d0..d084a03c 100644 --- a/test/v2/issues/190/asyncapi.gen.go +++ b/test/v2/issues/190/asyncapi.gen.go @@ -68,32 +68,32 @@ func (e *Error) Error() string { return fmt.Sprintf("channel %q: err %v", e.Channel, e.Err) } -// Issue169Msg1MessagePayload is a schema from the AsyncAPI specification required in messages -type Issue169Msg1MessagePayload struct { - Data *Issue169Msg1MessagePayloadData `json:"data"` +// V2Issue190Msg1MessagePayload is a schema from the AsyncAPI specification required in messages +type V2Issue190Msg1MessagePayload struct { + Data *V2Issue190Msg1MessagePayloadData `json:"data"` } -// Issue169Msg1MessagePayloadData is a schema from the AsyncAPI specification required in messages -type Issue169Msg1MessagePayloadData struct { +// V2Issue190Msg1MessagePayloadData is a schema from the AsyncAPI specification required in messages +type V2Issue190Msg1MessagePayloadData struct { Hello *string `json:"hello"` Id *string `json:"id"` } -// Issue169Msg1Message is the message expected for 'Issue169Msg1Message' channel. -type Issue169Msg1Message struct { +// V2Issue190Msg1Message is the message expected for 'V2Issue190Msg1Message' channel. +type V2Issue190Msg1Message struct { // Payload will be inserted in the message payload - Payload Issue169Msg1MessagePayload + Payload V2Issue190Msg1MessagePayload } -func NewIssue169Msg1Message() Issue169Msg1Message { - var msg Issue169Msg1Message +func NewV2Issue190Msg1Message() V2Issue190Msg1Message { + var msg V2Issue190Msg1Message return msg } -// brokerMessageToIssue169Msg1Message will fill a new Issue169Msg1Message with data from generic broker message -func brokerMessageToIssue169Msg1Message(bMsg extensions.BrokerMessage) (Issue169Msg1Message, error) { - var msg Issue169Msg1Message +// brokerMessageToV2Issue190Msg1Message will fill a new V2Issue190Msg1Message with data from generic broker message +func brokerMessageToV2Issue190Msg1Message(bMsg extensions.BrokerMessage) (V2Issue190Msg1Message, error) { + var msg V2Issue190Msg1Message // Unmarshal payload to expected message payload format err := json.Unmarshal(bMsg.Payload, &msg.Payload) @@ -106,8 +106,8 @@ func brokerMessageToIssue169Msg1Message(bMsg extensions.BrokerMessage) (Issue169 return msg, nil } -// toBrokerMessage will generate a generic broker message from Issue169Msg1Message data -func (msg Issue169Msg1Message) toBrokerMessage() (extensions.BrokerMessage, error) { +// toBrokerMessage will generate a generic broker message from V2Issue190Msg1Message data +func (msg V2Issue190Msg1Message) toBrokerMessage() (extensions.BrokerMessage, error) { // TODO: implement checks on message // Marshal payload to JSON @@ -125,32 +125,32 @@ func (msg Issue169Msg1Message) toBrokerMessage() (extensions.BrokerMessage, erro }, nil } -// Issue169Msg2MessagePayload is a schema from the AsyncAPI specification required in messages -type Issue169Msg2MessagePayload struct { - Data *Issue169Msg2MessagePayloadData `json:"data"` +// V2Issue190Msg2MessagePayload is a schema from the AsyncAPI specification required in messages +type V2Issue190Msg2MessagePayload struct { + Data *V2Issue190Msg2MessagePayloadData `json:"data"` } -// Issue169Msg2MessagePayloadData is a schema from the AsyncAPI specification required in messages -type Issue169Msg2MessagePayloadData struct { +// V2Issue190Msg2MessagePayloadData is a schema from the AsyncAPI specification required in messages +type V2Issue190Msg2MessagePayloadData struct { Bar *string `json:"bar"` Id *string `json:"id"` } -// Issue169Msg2Message is the message expected for 'Issue169Msg2Message' channel. -type Issue169Msg2Message struct { +// V2Issue190Msg2Message is the message expected for 'V2Issue190Msg2Message' channel. +type V2Issue190Msg2Message struct { // Payload will be inserted in the message payload - Payload Issue169Msg2MessagePayload + Payload V2Issue190Msg2MessagePayload } -func NewIssue169Msg2Message() Issue169Msg2Message { - var msg Issue169Msg2Message +func NewV2Issue190Msg2Message() V2Issue190Msg2Message { + var msg V2Issue190Msg2Message return msg } -// brokerMessageToIssue169Msg2Message will fill a new Issue169Msg2Message with data from generic broker message -func brokerMessageToIssue169Msg2Message(bMsg extensions.BrokerMessage) (Issue169Msg2Message, error) { - var msg Issue169Msg2Message +// brokerMessageToV2Issue190Msg2Message will fill a new V2Issue190Msg2Message with data from generic broker message +func brokerMessageToV2Issue190Msg2Message(bMsg extensions.BrokerMessage) (V2Issue190Msg2Message, error) { + var msg V2Issue190Msg2Message // Unmarshal payload to expected message payload format err := json.Unmarshal(bMsg.Payload, &msg.Payload) @@ -163,8 +163,8 @@ func brokerMessageToIssue169Msg2Message(bMsg extensions.BrokerMessage) (Issue169 return msg, nil } -// toBrokerMessage will generate a generic broker message from Issue169Msg2Message data -func (msg Issue169Msg2Message) toBrokerMessage() (extensions.BrokerMessage, error) { +// toBrokerMessage will generate a generic broker message from V2Issue190Msg2Message data +func (msg V2Issue190Msg2Message) toBrokerMessage() (extensions.BrokerMessage, error) { // TODO: implement checks on message // Marshal payload to JSON @@ -183,14 +183,14 @@ func (msg Issue169Msg2Message) toBrokerMessage() (extensions.BrokerMessage, erro } const ( - // Issue169Msg1Path is the constant representing the 'Issue169Msg1' channel path. - Issue169Msg1Path = "issue169.msg1" - // Issue169Msg2Path is the constant representing the 'Issue169Msg2' channel path. - Issue169Msg2Path = "issue169.msg2" + // V2Issue190Msg1Path is the constant representing the 'V2Issue190Msg1' channel path. + V2Issue190Msg1Path = "v2.issue190.msg1" + // V2Issue190Msg2Path is the constant representing the 'V2Issue190Msg2' channel path. + V2Issue190Msg2Path = "v2.issue190.msg2" ) // ChannelsPaths is an array of all channels paths var ChannelsPaths = []string{ - Issue169Msg1Path, - Issue169Msg2Path, + V2Issue190Msg1Path, + V2Issue190Msg2Path, } diff --git a/test/v2/issues/190/asyncapi.yaml b/test/v2/issues/190/asyncapi.yaml index afa8d60d..af7552f6 100644 --- a/test/v2/issues/190/asyncapi.yaml +++ b/test/v2/issues/190/asyncapi.yaml @@ -3,7 +3,7 @@ info: title: Sample App version: 1.0.0 channels: - issue169.msg1: + v2.issue190.msg1: publish: message: payload: @@ -16,7 +16,7 @@ channels: type: string hello: type: string - issue169.msg2: + v2.issue190.msg2: publish: message: payload: diff --git a/test/v2/issues/220/asyncapi.yaml b/test/v2/issues/220/asyncapi.yaml index 59641fe8..8bfe78b7 100644 --- a/test/v2/issues/220/asyncapi.yaml +++ b/test/v2/issues/220/asyncapi.yaml @@ -4,7 +4,7 @@ info: version: 1.2.3 channels: - v2.issue131.test: + v2.issue220.test: subscribe: message: payload: diff --git a/test/v2/issues/220/camel/asyncapi.gen.go b/test/v2/issues/220/camel/asyncapi.gen.go index 4d4e7377..5b1d24bc 100644 --- a/test/v2/issues/220/camel/asyncapi.gen.go +++ b/test/v2/issues/220/camel/asyncapi.gen.go @@ -109,13 +109,13 @@ func (c *AppController) Close(ctx context.Context) { // Unsubscribing remaining channels } -// PublishV2Issue131Test will publish messages to 'v2.issue131.test' channel -func (c *AppController) PublishV2Issue131Test( +// PublishV2Issue220Test will publish messages to 'v2.issue220.test' channel +func (c *AppController) PublishV2Issue220Test( ctx context.Context, - msg V2Issue131TestMessage, + msg V2Issue220TestMessage, ) error { // Get channel path - path := "v2.issue131.test" + path := "v2.issue220.test" // Set context ctx = addAppContextValues(ctx, path) @@ -138,8 +138,8 @@ func (c *AppController) PublishV2Issue131Test( // UserSubscriber represents all handlers that are expecting messages for User type UserSubscriber interface { - // V2Issue131Test subscribes to messages placed on the 'v2.issue131.test' channel - V2Issue131Test(ctx context.Context, msg V2Issue131TestMessage) error + // V2Issue220Test subscribes to messages placed on the 'v2.issue220.test' channel + V2Issue220Test(ctx context.Context, msg V2Issue220TestMessage) error } // UserController is the structure that provides publishing capabilities to the @@ -250,7 +250,7 @@ func (c *UserController) SubscribeAll(ctx context.Context, as UserSubscriber) er return extensions.ErrNilUserSubscriber } - if err := c.SubscribeV2Issue131Test(ctx, as.V2Issue131Test); err != nil { + if err := c.SubscribeV2Issue220Test(ctx, as.V2Issue220Test); err != nil { return err } @@ -259,18 +259,18 @@ func (c *UserController) SubscribeAll(ctx context.Context, as UserSubscriber) er // UnsubscribeAll will unsubscribe all remaining subscribed channels func (c *UserController) UnsubscribeAll(ctx context.Context) { - c.UnsubscribeV2Issue131Test(ctx) + c.UnsubscribeV2Issue220Test(ctx) } -// SubscribeV2Issue131Test will subscribe to new messages from 'v2.issue131.test' channel. +// SubscribeV2Issue220Test will subscribe to new messages from 'v2.issue220.test' channel. // // Callback function 'fn' will be called each time a new message is received. -func (c *UserController) SubscribeV2Issue131Test( +func (c *UserController) SubscribeV2Issue220Test( ctx context.Context, - fn func(ctx context.Context, msg V2Issue131TestMessage) error, + fn func(ctx context.Context, msg V2Issue220TestMessage) error, ) error { // Get channel path - path := "v2.issue131.test" + path := "v2.issue220.test" // Set context ctx = addUserContextValues(ctx, path) @@ -310,7 +310,7 @@ func (c *UserController) SubscribeV2Issue131Test( // Execute middlewares before handling the message if err := c.executeMiddlewares(ctx, &acknowledgeableBrokerMessage.BrokerMessage, func(ctx context.Context) error { // Process message - msg, err := brokerMessageToV2Issue131TestMessage(acknowledgeableBrokerMessage.BrokerMessage) + msg, err := brokerMessageToV2Issue220TestMessage(acknowledgeableBrokerMessage.BrokerMessage) if err != nil { return err } @@ -338,11 +338,11 @@ func (c *UserController) SubscribeV2Issue131Test( return nil } -// UnsubscribeV2Issue131Test will unsubscribe messages from 'v2.issue131.test' channel. +// UnsubscribeV2Issue220Test will unsubscribe messages from 'v2.issue220.test' channel. // A timeout can be set in context to avoid blocking operation, if needed. -func (c *UserController) UnsubscribeV2Issue131Test(ctx context.Context) { +func (c *UserController) UnsubscribeV2Issue220Test(ctx context.Context) { // Get channel path - path := "v2.issue131.test" + path := "v2.issue220.test" // Check if there subscribers for this channel sub, exists := c.subscriptions[path] @@ -420,21 +420,21 @@ func (e *Error) Error() string { return fmt.Sprintf("channel %q: err %v", e.Channel, e.Err) } -// V2Issue131TestMessage is the message expected for 'V2Issue131TestMessage' channel. -type V2Issue131TestMessage struct { +// V2Issue220TestMessage is the message expected for 'V2Issue220TestMessage' channel. +type V2Issue220TestMessage struct { // Payload will be inserted in the message payload Payload TestSchema } -func NewV2Issue131TestMessage() V2Issue131TestMessage { - var msg V2Issue131TestMessage +func NewV2Issue220TestMessage() V2Issue220TestMessage { + var msg V2Issue220TestMessage return msg } -// brokerMessageToV2Issue131TestMessage will fill a new V2Issue131TestMessage with data from generic broker message -func brokerMessageToV2Issue131TestMessage(bMsg extensions.BrokerMessage) (V2Issue131TestMessage, error) { - var msg V2Issue131TestMessage +// brokerMessageToV2Issue220TestMessage will fill a new V2Issue220TestMessage with data from generic broker message +func brokerMessageToV2Issue220TestMessage(bMsg extensions.BrokerMessage) (V2Issue220TestMessage, error) { + var msg V2Issue220TestMessage // Unmarshal payload to expected message payload format err := json.Unmarshal(bMsg.Payload, &msg.Payload) @@ -447,8 +447,8 @@ func brokerMessageToV2Issue131TestMessage(bMsg extensions.BrokerMessage) (V2Issu return msg, nil } -// toBrokerMessage will generate a generic broker message from V2Issue131TestMessage data -func (msg V2Issue131TestMessage) toBrokerMessage() (extensions.BrokerMessage, error) { +// toBrokerMessage will generate a generic broker message from V2Issue220TestMessage data +func (msg V2Issue220TestMessage) toBrokerMessage() (extensions.BrokerMessage, error) { // TODO: implement checks on message // Marshal payload to JSON @@ -473,11 +473,11 @@ type TestSchema struct { } const ( - // V2Issue131TestPath is the constant representing the 'V2Issue131Test' channel path. - V2Issue131TestPath = "v2.issue131.test" + // V2Issue220TestPath is the constant representing the 'V2Issue220Test' channel path. + V2Issue220TestPath = "v2.issue220.test" ) // ChannelsPaths is an array of all channels paths var ChannelsPaths = []string{ - V2Issue131TestPath, + V2Issue220TestPath, } diff --git a/test/v2/issues/220/none/asyncapi.gen.go b/test/v2/issues/220/none/asyncapi.gen.go index a056e525..c61a47c6 100644 --- a/test/v2/issues/220/none/asyncapi.gen.go +++ b/test/v2/issues/220/none/asyncapi.gen.go @@ -109,13 +109,13 @@ func (c *AppController) Close(ctx context.Context) { // Unsubscribing remaining channels } -// PublishV2Issue131Test will publish messages to 'v2.issue131.test' channel -func (c *AppController) PublishV2Issue131Test( +// PublishV2Issue220Test will publish messages to 'v2.issue220.test' channel +func (c *AppController) PublishV2Issue220Test( ctx context.Context, - msg V2Issue131TestMessage, + msg V2Issue220TestMessage, ) error { // Get channel path - path := "v2.issue131.test" + path := "v2.issue220.test" // Set context ctx = addAppContextValues(ctx, path) @@ -138,8 +138,8 @@ func (c *AppController) PublishV2Issue131Test( // UserSubscriber represents all handlers that are expecting messages for User type UserSubscriber interface { - // V2Issue131Test subscribes to messages placed on the 'v2.issue131.test' channel - V2Issue131Test(ctx context.Context, msg V2Issue131TestMessage) error + // V2Issue220Test subscribes to messages placed on the 'v2.issue220.test' channel + V2Issue220Test(ctx context.Context, msg V2Issue220TestMessage) error } // UserController is the structure that provides publishing capabilities to the @@ -250,7 +250,7 @@ func (c *UserController) SubscribeAll(ctx context.Context, as UserSubscriber) er return extensions.ErrNilUserSubscriber } - if err := c.SubscribeV2Issue131Test(ctx, as.V2Issue131Test); err != nil { + if err := c.SubscribeV2Issue220Test(ctx, as.V2Issue220Test); err != nil { return err } @@ -259,18 +259,18 @@ func (c *UserController) SubscribeAll(ctx context.Context, as UserSubscriber) er // UnsubscribeAll will unsubscribe all remaining subscribed channels func (c *UserController) UnsubscribeAll(ctx context.Context) { - c.UnsubscribeV2Issue131Test(ctx) + c.UnsubscribeV2Issue220Test(ctx) } -// SubscribeV2Issue131Test will subscribe to new messages from 'v2.issue131.test' channel. +// SubscribeV2Issue220Test will subscribe to new messages from 'v2.issue220.test' channel. // // Callback function 'fn' will be called each time a new message is received. -func (c *UserController) SubscribeV2Issue131Test( +func (c *UserController) SubscribeV2Issue220Test( ctx context.Context, - fn func(ctx context.Context, msg V2Issue131TestMessage) error, + fn func(ctx context.Context, msg V2Issue220TestMessage) error, ) error { // Get channel path - path := "v2.issue131.test" + path := "v2.issue220.test" // Set context ctx = addUserContextValues(ctx, path) @@ -310,7 +310,7 @@ func (c *UserController) SubscribeV2Issue131Test( // Execute middlewares before handling the message if err := c.executeMiddlewares(ctx, &acknowledgeableBrokerMessage.BrokerMessage, func(ctx context.Context) error { // Process message - msg, err := brokerMessageToV2Issue131TestMessage(acknowledgeableBrokerMessage.BrokerMessage) + msg, err := brokerMessageToV2Issue220TestMessage(acknowledgeableBrokerMessage.BrokerMessage) if err != nil { return err } @@ -338,11 +338,11 @@ func (c *UserController) SubscribeV2Issue131Test( return nil } -// UnsubscribeV2Issue131Test will unsubscribe messages from 'v2.issue131.test' channel. +// UnsubscribeV2Issue220Test will unsubscribe messages from 'v2.issue220.test' channel. // A timeout can be set in context to avoid blocking operation, if needed. -func (c *UserController) UnsubscribeV2Issue131Test(ctx context.Context) { +func (c *UserController) UnsubscribeV2Issue220Test(ctx context.Context) { // Get channel path - path := "v2.issue131.test" + path := "v2.issue220.test" // Check if there subscribers for this channel sub, exists := c.subscriptions[path] @@ -420,21 +420,21 @@ func (e *Error) Error() string { return fmt.Sprintf("channel %q: err %v", e.Channel, e.Err) } -// V2Issue131TestMessage is the message expected for 'V2Issue131TestMessage' channel. -type V2Issue131TestMessage struct { +// V2Issue220TestMessage is the message expected for 'V2Issue220TestMessage' channel. +type V2Issue220TestMessage struct { // Payload will be inserted in the message payload Payload TESTSchema } -func NewV2Issue131TestMessage() V2Issue131TestMessage { - var msg V2Issue131TestMessage +func NewV2Issue220TestMessage() V2Issue220TestMessage { + var msg V2Issue220TestMessage return msg } -// brokerMessageToV2Issue131TestMessage will fill a new V2Issue131TestMessage with data from generic broker message -func brokerMessageToV2Issue131TestMessage(bMsg extensions.BrokerMessage) (V2Issue131TestMessage, error) { - var msg V2Issue131TestMessage +// brokerMessageToV2Issue220TestMessage will fill a new V2Issue220TestMessage with data from generic broker message +func brokerMessageToV2Issue220TestMessage(bMsg extensions.BrokerMessage) (V2Issue220TestMessage, error) { + var msg V2Issue220TestMessage // Unmarshal payload to expected message payload format err := json.Unmarshal(bMsg.Payload, &msg.Payload) @@ -447,8 +447,8 @@ func brokerMessageToV2Issue131TestMessage(bMsg extensions.BrokerMessage) (V2Issu return msg, nil } -// toBrokerMessage will generate a generic broker message from V2Issue131TestMessage data -func (msg V2Issue131TestMessage) toBrokerMessage() (extensions.BrokerMessage, error) { +// toBrokerMessage will generate a generic broker message from V2Issue220TestMessage data +func (msg V2Issue220TestMessage) toBrokerMessage() (extensions.BrokerMessage, error) { // TODO: implement checks on message // Marshal payload to JSON @@ -473,11 +473,11 @@ type TESTSchema struct { } const ( - // V2Issue131TestPath is the constant representing the 'V2Issue131Test' channel path. - V2Issue131TestPath = "v2.issue131.test" + // V2Issue220TestPath is the constant representing the 'V2Issue220Test' channel path. + V2Issue220TestPath = "v2.issue220.test" ) // ChannelsPaths is an array of all channels paths var ChannelsPaths = []string{ - V2Issue131TestPath, + V2Issue220TestPath, } diff --git a/test/v3/issues/135/asyncapi.gen.go b/test/v3/issues/135/asyncapi.gen.go index 69d174eb..b0237b55 100644 --- a/test/v3/issues/135/asyncapi.gen.go +++ b/test/v3/issues/135/asyncapi.gen.go @@ -69,15 +69,15 @@ func (e *Error) Error() string { const ( // GroupChannelPath is the constant representing the 'GroupChannel' channel path. - GroupChannelPath = "group" + GroupChannelPath = "v3.issue135.group" // InfoChannelPath is the constant representing the 'InfoChannel' channel path. - InfoChannelPath = "info" + InfoChannelPath = "v3.issue135.info" // ProjectChannelPath is the constant representing the 'ProjectChannel' channel path. - ProjectChannelPath = "project" + ProjectChannelPath = "v3.issue135.project" // ResourceChannelPath is the constant representing the 'ResourceChannel' channel path. - ResourceChannelPath = "resource" + ResourceChannelPath = "v3.issue135.resource" // StatusChannelPath is the constant representing the 'StatusChannel' channel path. - StatusChannelPath = "status" + StatusChannelPath = "v3.issue135.status" ) // ChannelsPaths is an array of all channels paths diff --git a/test/v3/issues/135/asyncapi.yaml b/test/v3/issues/135/asyncapi.yaml index 5949dae8..45210449 100644 --- a/test/v3/issues/135/asyncapi.yaml +++ b/test/v3/issues/135/asyncapi.yaml @@ -10,12 +10,12 @@ info: version: 1.2.3 channels: resource: - address: resource + address: v3.issue135.resource info: - address: info + address: v3.issue135.info status: - address: status + address: v3.issue135.status project: - address: project + address: v3.issue135.project group: - address: group \ No newline at end of file + address: v3.issue135.group \ No newline at end of file diff --git a/test/v3/issues/135/suite_test.go b/test/v3/issues/135/suite_test.go index 7ec3594d..d3e5076a 100644 --- a/test/v3/issues/135/suite_test.go +++ b/test/v3/issues/135/suite_test.go @@ -18,11 +18,11 @@ type Suite struct { func (suite *Suite) TestCheckPaths() { // Check path contents - suite.Require().Equal("group", GroupChannelPath) - suite.Require().Equal("info", InfoChannelPath) - suite.Require().Equal("project", ProjectChannelPath) - suite.Require().Equal("resource", ResourceChannelPath) - suite.Require().Equal("status", StatusChannelPath) + suite.Require().Equal("v3.issue135.group", GroupChannelPath) + suite.Require().Equal("v3.issue135.info", InfoChannelPath) + suite.Require().Equal("v3.issue135.project", ProjectChannelPath) + suite.Require().Equal("v3.issue135.resource", ResourceChannelPath) + suite.Require().Equal("v3.issue135.status", StatusChannelPath) // Check path list for _, p := range ChannelsPaths { diff --git a/test/v3/issues/190/asyncapi.gen.go b/test/v3/issues/190/asyncapi.gen.go index 7c997122..a8ec9f96 100644 --- a/test/v3/issues/190/asyncapi.gen.go +++ b/test/v3/issues/190/asyncapi.gen.go @@ -184,9 +184,9 @@ func (msg SayHelloMessageFromHelloChannel) toBrokerMessage() (extensions.BrokerM const ( // FooChannelPath is the constant representing the 'FooChannel' channel path. - FooChannelPath = "hello" + FooChannelPath = "v3.issue190.foo" // HelloChannelPath is the constant representing the 'HelloChannel' channel path. - HelloChannelPath = "hello" + HelloChannelPath = "v3.issue190.hello" ) // ChannelsPaths is an array of all channels paths diff --git a/test/v3/issues/190/asyncapi.yaml b/test/v3/issues/190/asyncapi.yaml index 67745c42..158370d9 100644 --- a/test/v3/issues/190/asyncapi.yaml +++ b/test/v3/issues/190/asyncapi.yaml @@ -4,7 +4,7 @@ info: version: '0.1.0' channels: hello: - address: 'hello' + address: v3.issue190.hello messages: sayHello: payload: @@ -18,7 +18,7 @@ channels: hello: type: string foo: - address: 'hello' + address: 'v3.issue190.foo' messages: bar: payload: diff --git a/test/v3/issues/211/asyncapi.gen.go b/test/v3/issues/211/asyncapi.gen.go index 0d96e0c9..c70fdf3c 100644 --- a/test/v3/issues/211/asyncapi.gen.go +++ b/test/v3/issues/211/asyncapi.gen.go @@ -127,7 +127,7 @@ func (msg EventSuccessMessage) toBrokerMessage() (extensions.BrokerMessage, erro const ( // EventSuccessChannelPath is the constant representing the 'EventSuccessChannel' channel path. - EventSuccessChannelPath = "some.random.topic" + EventSuccessChannelPath = "v3.issue211.topic" ) // ChannelsPaths is an array of all channels paths diff --git a/test/v3/issues/211/asyncapi.yaml b/test/v3/issues/211/asyncapi.yaml index cbcc31c3..0a3cab24 100644 --- a/test/v3/issues/211/asyncapi.yaml +++ b/test/v3/issues/211/asyncapi.yaml @@ -4,7 +4,7 @@ info: version: 0.1.0 channels: eventSuccess: - address: some.random.topic + address: v3.issue211.topic messages: eventSuccessMessage: $ref: "#/components/messages/EventSuccess" diff --git a/test/v3/issues/220/asyncapi.yaml b/test/v3/issues/220/asyncapi.yaml index 59641fe8..8bfe78b7 100644 --- a/test/v3/issues/220/asyncapi.yaml +++ b/test/v3/issues/220/asyncapi.yaml @@ -4,7 +4,7 @@ info: version: 1.2.3 channels: - v2.issue131.test: + v2.issue220.test: subscribe: message: payload: diff --git a/test/v3/issues/220/camel/asyncapi.gen.go b/test/v3/issues/220/camel/asyncapi.gen.go index 4d4e7377..5b1d24bc 100644 --- a/test/v3/issues/220/camel/asyncapi.gen.go +++ b/test/v3/issues/220/camel/asyncapi.gen.go @@ -109,13 +109,13 @@ func (c *AppController) Close(ctx context.Context) { // Unsubscribing remaining channels } -// PublishV2Issue131Test will publish messages to 'v2.issue131.test' channel -func (c *AppController) PublishV2Issue131Test( +// PublishV2Issue220Test will publish messages to 'v2.issue220.test' channel +func (c *AppController) PublishV2Issue220Test( ctx context.Context, - msg V2Issue131TestMessage, + msg V2Issue220TestMessage, ) error { // Get channel path - path := "v2.issue131.test" + path := "v2.issue220.test" // Set context ctx = addAppContextValues(ctx, path) @@ -138,8 +138,8 @@ func (c *AppController) PublishV2Issue131Test( // UserSubscriber represents all handlers that are expecting messages for User type UserSubscriber interface { - // V2Issue131Test subscribes to messages placed on the 'v2.issue131.test' channel - V2Issue131Test(ctx context.Context, msg V2Issue131TestMessage) error + // V2Issue220Test subscribes to messages placed on the 'v2.issue220.test' channel + V2Issue220Test(ctx context.Context, msg V2Issue220TestMessage) error } // UserController is the structure that provides publishing capabilities to the @@ -250,7 +250,7 @@ func (c *UserController) SubscribeAll(ctx context.Context, as UserSubscriber) er return extensions.ErrNilUserSubscriber } - if err := c.SubscribeV2Issue131Test(ctx, as.V2Issue131Test); err != nil { + if err := c.SubscribeV2Issue220Test(ctx, as.V2Issue220Test); err != nil { return err } @@ -259,18 +259,18 @@ func (c *UserController) SubscribeAll(ctx context.Context, as UserSubscriber) er // UnsubscribeAll will unsubscribe all remaining subscribed channels func (c *UserController) UnsubscribeAll(ctx context.Context) { - c.UnsubscribeV2Issue131Test(ctx) + c.UnsubscribeV2Issue220Test(ctx) } -// SubscribeV2Issue131Test will subscribe to new messages from 'v2.issue131.test' channel. +// SubscribeV2Issue220Test will subscribe to new messages from 'v2.issue220.test' channel. // // Callback function 'fn' will be called each time a new message is received. -func (c *UserController) SubscribeV2Issue131Test( +func (c *UserController) SubscribeV2Issue220Test( ctx context.Context, - fn func(ctx context.Context, msg V2Issue131TestMessage) error, + fn func(ctx context.Context, msg V2Issue220TestMessage) error, ) error { // Get channel path - path := "v2.issue131.test" + path := "v2.issue220.test" // Set context ctx = addUserContextValues(ctx, path) @@ -310,7 +310,7 @@ func (c *UserController) SubscribeV2Issue131Test( // Execute middlewares before handling the message if err := c.executeMiddlewares(ctx, &acknowledgeableBrokerMessage.BrokerMessage, func(ctx context.Context) error { // Process message - msg, err := brokerMessageToV2Issue131TestMessage(acknowledgeableBrokerMessage.BrokerMessage) + msg, err := brokerMessageToV2Issue220TestMessage(acknowledgeableBrokerMessage.BrokerMessage) if err != nil { return err } @@ -338,11 +338,11 @@ func (c *UserController) SubscribeV2Issue131Test( return nil } -// UnsubscribeV2Issue131Test will unsubscribe messages from 'v2.issue131.test' channel. +// UnsubscribeV2Issue220Test will unsubscribe messages from 'v2.issue220.test' channel. // A timeout can be set in context to avoid blocking operation, if needed. -func (c *UserController) UnsubscribeV2Issue131Test(ctx context.Context) { +func (c *UserController) UnsubscribeV2Issue220Test(ctx context.Context) { // Get channel path - path := "v2.issue131.test" + path := "v2.issue220.test" // Check if there subscribers for this channel sub, exists := c.subscriptions[path] @@ -420,21 +420,21 @@ func (e *Error) Error() string { return fmt.Sprintf("channel %q: err %v", e.Channel, e.Err) } -// V2Issue131TestMessage is the message expected for 'V2Issue131TestMessage' channel. -type V2Issue131TestMessage struct { +// V2Issue220TestMessage is the message expected for 'V2Issue220TestMessage' channel. +type V2Issue220TestMessage struct { // Payload will be inserted in the message payload Payload TestSchema } -func NewV2Issue131TestMessage() V2Issue131TestMessage { - var msg V2Issue131TestMessage +func NewV2Issue220TestMessage() V2Issue220TestMessage { + var msg V2Issue220TestMessage return msg } -// brokerMessageToV2Issue131TestMessage will fill a new V2Issue131TestMessage with data from generic broker message -func brokerMessageToV2Issue131TestMessage(bMsg extensions.BrokerMessage) (V2Issue131TestMessage, error) { - var msg V2Issue131TestMessage +// brokerMessageToV2Issue220TestMessage will fill a new V2Issue220TestMessage with data from generic broker message +func brokerMessageToV2Issue220TestMessage(bMsg extensions.BrokerMessage) (V2Issue220TestMessage, error) { + var msg V2Issue220TestMessage // Unmarshal payload to expected message payload format err := json.Unmarshal(bMsg.Payload, &msg.Payload) @@ -447,8 +447,8 @@ func brokerMessageToV2Issue131TestMessage(bMsg extensions.BrokerMessage) (V2Issu return msg, nil } -// toBrokerMessage will generate a generic broker message from V2Issue131TestMessage data -func (msg V2Issue131TestMessage) toBrokerMessage() (extensions.BrokerMessage, error) { +// toBrokerMessage will generate a generic broker message from V2Issue220TestMessage data +func (msg V2Issue220TestMessage) toBrokerMessage() (extensions.BrokerMessage, error) { // TODO: implement checks on message // Marshal payload to JSON @@ -473,11 +473,11 @@ type TestSchema struct { } const ( - // V2Issue131TestPath is the constant representing the 'V2Issue131Test' channel path. - V2Issue131TestPath = "v2.issue131.test" + // V2Issue220TestPath is the constant representing the 'V2Issue220Test' channel path. + V2Issue220TestPath = "v2.issue220.test" ) // ChannelsPaths is an array of all channels paths var ChannelsPaths = []string{ - V2Issue131TestPath, + V2Issue220TestPath, } diff --git a/test/v3/issues/220/none/asyncapi.gen.go b/test/v3/issues/220/none/asyncapi.gen.go index a056e525..c61a47c6 100644 --- a/test/v3/issues/220/none/asyncapi.gen.go +++ b/test/v3/issues/220/none/asyncapi.gen.go @@ -109,13 +109,13 @@ func (c *AppController) Close(ctx context.Context) { // Unsubscribing remaining channels } -// PublishV2Issue131Test will publish messages to 'v2.issue131.test' channel -func (c *AppController) PublishV2Issue131Test( +// PublishV2Issue220Test will publish messages to 'v2.issue220.test' channel +func (c *AppController) PublishV2Issue220Test( ctx context.Context, - msg V2Issue131TestMessage, + msg V2Issue220TestMessage, ) error { // Get channel path - path := "v2.issue131.test" + path := "v2.issue220.test" // Set context ctx = addAppContextValues(ctx, path) @@ -138,8 +138,8 @@ func (c *AppController) PublishV2Issue131Test( // UserSubscriber represents all handlers that are expecting messages for User type UserSubscriber interface { - // V2Issue131Test subscribes to messages placed on the 'v2.issue131.test' channel - V2Issue131Test(ctx context.Context, msg V2Issue131TestMessage) error + // V2Issue220Test subscribes to messages placed on the 'v2.issue220.test' channel + V2Issue220Test(ctx context.Context, msg V2Issue220TestMessage) error } // UserController is the structure that provides publishing capabilities to the @@ -250,7 +250,7 @@ func (c *UserController) SubscribeAll(ctx context.Context, as UserSubscriber) er return extensions.ErrNilUserSubscriber } - if err := c.SubscribeV2Issue131Test(ctx, as.V2Issue131Test); err != nil { + if err := c.SubscribeV2Issue220Test(ctx, as.V2Issue220Test); err != nil { return err } @@ -259,18 +259,18 @@ func (c *UserController) SubscribeAll(ctx context.Context, as UserSubscriber) er // UnsubscribeAll will unsubscribe all remaining subscribed channels func (c *UserController) UnsubscribeAll(ctx context.Context) { - c.UnsubscribeV2Issue131Test(ctx) + c.UnsubscribeV2Issue220Test(ctx) } -// SubscribeV2Issue131Test will subscribe to new messages from 'v2.issue131.test' channel. +// SubscribeV2Issue220Test will subscribe to new messages from 'v2.issue220.test' channel. // // Callback function 'fn' will be called each time a new message is received. -func (c *UserController) SubscribeV2Issue131Test( +func (c *UserController) SubscribeV2Issue220Test( ctx context.Context, - fn func(ctx context.Context, msg V2Issue131TestMessage) error, + fn func(ctx context.Context, msg V2Issue220TestMessage) error, ) error { // Get channel path - path := "v2.issue131.test" + path := "v2.issue220.test" // Set context ctx = addUserContextValues(ctx, path) @@ -310,7 +310,7 @@ func (c *UserController) SubscribeV2Issue131Test( // Execute middlewares before handling the message if err := c.executeMiddlewares(ctx, &acknowledgeableBrokerMessage.BrokerMessage, func(ctx context.Context) error { // Process message - msg, err := brokerMessageToV2Issue131TestMessage(acknowledgeableBrokerMessage.BrokerMessage) + msg, err := brokerMessageToV2Issue220TestMessage(acknowledgeableBrokerMessage.BrokerMessage) if err != nil { return err } @@ -338,11 +338,11 @@ func (c *UserController) SubscribeV2Issue131Test( return nil } -// UnsubscribeV2Issue131Test will unsubscribe messages from 'v2.issue131.test' channel. +// UnsubscribeV2Issue220Test will unsubscribe messages from 'v2.issue220.test' channel. // A timeout can be set in context to avoid blocking operation, if needed. -func (c *UserController) UnsubscribeV2Issue131Test(ctx context.Context) { +func (c *UserController) UnsubscribeV2Issue220Test(ctx context.Context) { // Get channel path - path := "v2.issue131.test" + path := "v2.issue220.test" // Check if there subscribers for this channel sub, exists := c.subscriptions[path] @@ -420,21 +420,21 @@ func (e *Error) Error() string { return fmt.Sprintf("channel %q: err %v", e.Channel, e.Err) } -// V2Issue131TestMessage is the message expected for 'V2Issue131TestMessage' channel. -type V2Issue131TestMessage struct { +// V2Issue220TestMessage is the message expected for 'V2Issue220TestMessage' channel. +type V2Issue220TestMessage struct { // Payload will be inserted in the message payload Payload TESTSchema } -func NewV2Issue131TestMessage() V2Issue131TestMessage { - var msg V2Issue131TestMessage +func NewV2Issue220TestMessage() V2Issue220TestMessage { + var msg V2Issue220TestMessage return msg } -// brokerMessageToV2Issue131TestMessage will fill a new V2Issue131TestMessage with data from generic broker message -func brokerMessageToV2Issue131TestMessage(bMsg extensions.BrokerMessage) (V2Issue131TestMessage, error) { - var msg V2Issue131TestMessage +// brokerMessageToV2Issue220TestMessage will fill a new V2Issue220TestMessage with data from generic broker message +func brokerMessageToV2Issue220TestMessage(bMsg extensions.BrokerMessage) (V2Issue220TestMessage, error) { + var msg V2Issue220TestMessage // Unmarshal payload to expected message payload format err := json.Unmarshal(bMsg.Payload, &msg.Payload) @@ -447,8 +447,8 @@ func brokerMessageToV2Issue131TestMessage(bMsg extensions.BrokerMessage) (V2Issu return msg, nil } -// toBrokerMessage will generate a generic broker message from V2Issue131TestMessage data -func (msg V2Issue131TestMessage) toBrokerMessage() (extensions.BrokerMessage, error) { +// toBrokerMessage will generate a generic broker message from V2Issue220TestMessage data +func (msg V2Issue220TestMessage) toBrokerMessage() (extensions.BrokerMessage, error) { // TODO: implement checks on message // Marshal payload to JSON @@ -473,11 +473,11 @@ type TESTSchema struct { } const ( - // V2Issue131TestPath is the constant representing the 'V2Issue131Test' channel path. - V2Issue131TestPath = "v2.issue131.test" + // V2Issue220TestPath is the constant representing the 'V2Issue220Test' channel path. + V2Issue220TestPath = "v2.issue220.test" ) // ChannelsPaths is an array of all channels paths var ChannelsPaths = []string{ - V2Issue131TestPath, + V2Issue220TestPath, }