micro-tests/broker/broker_test.go
Vasiliy Tolstov 32039b342f update tests and deps
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-07-05 16:26:57 +03:00

20 lines
410 B
Go

package broker
import (
"testing"
jsoncodec "github.com/unistack-org/micro-codec-json/v3"
"github.com/unistack-org/micro/v3/broker"
)
func TestBrokerMessage(t *testing.T) {
c := jsoncodec.NewCodec()
buf := []byte(`{"Header":{"Content-Type":"application\/json","Micro-Topic":"notify"},"Body":{"Class":{}}}`)
msg := &broker.Message{}
if err := c.Unmarshal(buf, msg); err != nil {
t.Fatal(err)
}
}