github.com/vmware/transport-go@v1.3.4/bus/message_test.go (about)

     1  // Copyright 2019-2020 VMware, Inc.
     2  // SPDX-License-Identifier: BSD-2-Clause
     3  
     4  package bus
     5  
     6  import (
     7  	"github.com/google/uuid"
     8  	"github.com/stretchr/testify/assert"
     9  	"github.com/vmware/transport-go/model"
    10  	"testing"
    11  )
    12  
    13  func TestMessageModel(t *testing.T) {
    14  	id := uuid.New()
    15  	var message = &model.Message{
    16  		Id:        &id,
    17  		Payload:   "A new message",
    18  		Channel:   "123",
    19  		Direction: model.RequestDir}
    20  	assert.Equal(t, "A new message", message.Payload)
    21  	assert.Equal(t, model.RequestDir, message.Direction)
    22  	assert.Equal(t, message.Channel, "123")
    23  }