metadata: add default headers

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-07-23 12:03:18 +03:00
parent d357fb1e0d
commit 675e121049
6 changed files with 33 additions and 13 deletions

View File

@@ -4,6 +4,8 @@ import (
"context"
"fmt"
"testing"
"github.com/unistack-org/micro/v3/metadata"
)
func TestMemoryBatchBroker(t *testing.T) {
@@ -30,9 +32,9 @@ func TestMemoryBatchBroker(t *testing.T) {
for i := 0; i < count; i++ {
message := &Message{
Header: map[string]string{
"Micro-Topic": topic,
"foo": "bar",
"id": fmt.Sprintf("%d", i),
metadata.HeaderTopic: topic,
"foo": "bar",
"id": fmt.Sprintf("%d", i),
},
Body: []byte(`"hello world"`),
}
@@ -75,9 +77,9 @@ func TestMemoryBroker(t *testing.T) {
for i := 0; i < count; i++ {
message := &Message{
Header: map[string]string{
"Micro-Topic": topic,
"foo": "bar",
"id": fmt.Sprintf("%d", i),
metadata.HeaderTopic: topic,
"foo": "bar",
"id": fmt.Sprintf("%d", i),
},
Body: []byte(`"hello world"`),
}