fix the test case
This commit is contained in:
parent
4ae9604043
commit
b2237cb144
1 changed files with 14 additions and 6 deletions
|
|
@ -34,11 +34,19 @@ func TestHandleC2CMessage_IncludesAccountIDMetadata(t *testing.T) {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
inbound, ok := messageBus.ConsumeInbound(ctx)
|
for {
|
||||||
if !ok {
|
select {
|
||||||
t.Fatal("expected inbound message")
|
case <-ctx.Done():
|
||||||
}
|
t.Fatal("timeout waiting for inbound message")
|
||||||
if inbound.Metadata["account_id"] != "7750283E123456" {
|
return
|
||||||
t.Fatalf("account_id metadata = %q, want %q", inbound.Metadata["account_id"], "7750283E123456")
|
case inbound, ok := <-messageBus.InboundChan():
|
||||||
|
if !ok {
|
||||||
|
t.Fatal("expected inbound message")
|
||||||
|
}
|
||||||
|
if inbound.Metadata["account_id"] != "7750283E123456" {
|
||||||
|
t.Fatalf("account_id metadata = %q, want %q", inbound.Metadata["account_id"], "7750283E123456")
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue