1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-09-01 21:18:12 +02:00

transport/publisher.go: pass ChannelInterface instead of string to Publish()

This commit is contained in:
Henrik Hautakoski 2023-01-19 17:42:26 +01:00
parent 5202247200
commit 69a9e9f47d
4 changed files with 11 additions and 8 deletions

View file

@ -3,6 +3,8 @@ package redis_pubsub
import (
"testing"
"eosio-ship-trace-reader/transport"
"github.com/go-redis/redismock/v8"
"github.com/stretchr/testify/assert"
)
@ -16,8 +18,8 @@ func TestRedisPubsub(t *testing.T) {
mock.ExpectPublish("test", []byte("some string")).SetVal(0)
mock.ExpectPublish("test2", []byte("some other string")).SetVal(0)
assert.NoError(t, pubsub.Publish("test", []byte("some string")))
assert.NoError(t, pubsub.Publish("test2", []byte("some other string")))
assert.NoError(t, pubsub.Publish(transport.Channel{"test"}, []byte("some string")))
assert.NoError(t, pubsub.Publish(transport.Channel{"test2"}, []byte("some other string")))
assert.NoError(t, pubsub.Flush())
assert.NoError(t, mock.ExpectationsWereMet())