fix(cron): update test to use OutboundChan instead of removed SubscribeOutbound
The SubscribeOutbound method was removed in commit 9c31b0c but cron_test.go
was not updated to use the new OutboundChan() API.
This commit is contained in:
parent
9c31b0ca95
commit
61a899cfbc
1 changed files with 6 additions and 3 deletions
|
|
@ -226,9 +226,12 @@ func TestCronTool_ExecuteJobPublishesErrorWhenExecDisabled(t *testing.T) {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
msg, ok := tool.msgBus.SubscribeOutbound(ctx)
|
var msg bus.OutboundMessage
|
||||||
if !ok {
|
select {
|
||||||
t.Fatal("expected outbound message")
|
case msg = <-tool.msgBus.OutboundChan():
|
||||||
|
// got message
|
||||||
|
case <-ctx.Done():
|
||||||
|
t.Fatal("timeout waiting for outbound message")
|
||||||
}
|
}
|
||||||
if !strings.Contains(msg.Content, "command execution is disabled") {
|
if !strings.Contains(msg.Content, "command execution is disabled") {
|
||||||
t.Fatalf("expected exec disabled message, got: %s", msg.Content)
|
t.Fatalf("expected exec disabled message, got: %s", msg.Content)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue