Skip to content

Commit b04a8f2

Browse files
committed
fix tests
1 parent 2eb2bdb commit b04a8f2

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

internal/api/api_test.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func nodeWithMemoryEngine() *centrifuge.Node {
2323

2424
func TestPublishAPI(t *testing.T) {
2525
node := nodeWithMemoryEngine()
26-
api := newAPIExecutor(node)
26+
api := newAPIExecutor(node, "test")
2727
resp := api.Publish(context.Background(), &PublishRequest{})
2828
assert.Equal(t, ErrorBadRequest, resp.Error)
2929

@@ -39,7 +39,7 @@ func TestPublishAPI(t *testing.T) {
3939

4040
func TestBroadcastAPI(t *testing.T) {
4141
node := nodeWithMemoryEngine()
42-
api := newAPIExecutor(node)
42+
api := newAPIExecutor(node, "test")
4343
resp := api.Broadcast(context.Background(), &BroadcastRequest{})
4444
assert.Equal(t, ErrorBadRequest, resp.Error)
4545

@@ -58,7 +58,7 @@ func TestBroadcastAPI(t *testing.T) {
5858

5959
func TestHistoryAPI(t *testing.T) {
6060
node := nodeWithMemoryEngine()
61-
api := newAPIExecutor(node)
61+
api := newAPIExecutor(node, "test")
6262
resp := api.History(context.Background(), &HistoryRequest{})
6363
assert.Equal(t, ErrorBadRequest, resp.Error)
6464
resp = api.History(context.Background(), &HistoryRequest{Channel: "test"})
@@ -75,7 +75,7 @@ func TestHistoryAPI(t *testing.T) {
7575

7676
func TestHistoryRemoveAPI(t *testing.T) {
7777
node := nodeWithMemoryEngine()
78-
api := newAPIExecutor(node)
78+
api := newAPIExecutor(node, "test")
7979
resp := api.HistoryRemove(context.Background(), &HistoryRemoveRequest{})
8080
assert.Equal(t, ErrorBadRequest, resp.Error)
8181
resp = api.HistoryRemove(context.Background(), &HistoryRemoveRequest{Channel: "test"})
@@ -92,7 +92,7 @@ func TestHistoryRemoveAPI(t *testing.T) {
9292

9393
func TestPresenceAPI(t *testing.T) {
9494
node := nodeWithMemoryEngine()
95-
api := newAPIExecutor(node)
95+
api := newAPIExecutor(node, "test")
9696
resp := api.Presence(context.Background(), &PresenceRequest{})
9797
assert.Equal(t, ErrorBadRequest, resp.Error)
9898
resp = api.Presence(context.Background(), &PresenceRequest{Channel: "test"})
@@ -109,7 +109,7 @@ func TestPresenceAPI(t *testing.T) {
109109

110110
func TestPresenceStatsAPI(t *testing.T) {
111111
node := nodeWithMemoryEngine()
112-
api := newAPIExecutor(node)
112+
api := newAPIExecutor(node, "test")
113113
resp := api.PresenceStats(context.Background(), &PresenceStatsRequest{})
114114
assert.Equal(t, ErrorBadRequest, resp.Error)
115115
resp = api.PresenceStats(context.Background(), &PresenceStatsRequest{Channel: "test"})
@@ -125,7 +125,7 @@ func TestPresenceStatsAPI(t *testing.T) {
125125

126126
func TestDisconnectAPI(t *testing.T) {
127127
node := nodeWithMemoryEngine()
128-
api := newAPIExecutor(node)
128+
api := newAPIExecutor(node, "test")
129129
resp := api.Disconnect(context.Background(), &DisconnectRequest{})
130130
assert.Equal(t, ErrorBadRequest, resp.Error)
131131
resp = api.Disconnect(context.Background(), &DisconnectRequest{
@@ -136,7 +136,7 @@ func TestDisconnectAPI(t *testing.T) {
136136

137137
func TestUnsubscribeAPI(t *testing.T) {
138138
node := nodeWithMemoryEngine()
139-
api := newAPIExecutor(node)
139+
api := newAPIExecutor(node, "test")
140140
resp := api.Unsubscribe(context.Background(), &UnsubscribeRequest{})
141141
assert.Equal(t, ErrorBadRequest, resp.Error)
142142
resp = api.Unsubscribe(context.Background(), &UnsubscribeRequest{
@@ -148,14 +148,14 @@ func TestUnsubscribeAPI(t *testing.T) {
148148

149149
func TestChannelsAPI(t *testing.T) {
150150
node := nodeWithMemoryEngine()
151-
api := newAPIExecutor(node)
151+
api := newAPIExecutor(node, "test")
152152
resp := api.Channels(context.Background(), &ChannelsRequest{})
153153
assert.Nil(t, resp.Error)
154154
}
155155

156156
func TestInfoAPI(t *testing.T) {
157157
node := nodeWithMemoryEngine()
158-
api := newAPIExecutor(node)
158+
api := newAPIExecutor(node, "test")
159159
resp := api.Info(context.Background(), &InfoRequest{})
160160
assert.Nil(t, resp.Error)
161161
}

0 commit comments

Comments
 (0)