Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Aug 5, 2018
1 parent 2eb2bdb commit b04a8f2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions internal/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func nodeWithMemoryEngine() *centrifuge.Node {

func TestPublishAPI(t *testing.T) {
node := nodeWithMemoryEngine()
api := newAPIExecutor(node)
api := newAPIExecutor(node, "test")
resp := api.Publish(context.Background(), &PublishRequest{})
assert.Equal(t, ErrorBadRequest, resp.Error)

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

func TestBroadcastAPI(t *testing.T) {
node := nodeWithMemoryEngine()
api := newAPIExecutor(node)
api := newAPIExecutor(node, "test")
resp := api.Broadcast(context.Background(), &BroadcastRequest{})
assert.Equal(t, ErrorBadRequest, resp.Error)

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

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

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

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

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

func TestDisconnectAPI(t *testing.T) {
node := nodeWithMemoryEngine()
api := newAPIExecutor(node)
api := newAPIExecutor(node, "test")
resp := api.Disconnect(context.Background(), &DisconnectRequest{})
assert.Equal(t, ErrorBadRequest, resp.Error)
resp = api.Disconnect(context.Background(), &DisconnectRequest{
Expand All @@ -136,7 +136,7 @@ func TestDisconnectAPI(t *testing.T) {

func TestUnsubscribeAPI(t *testing.T) {
node := nodeWithMemoryEngine()
api := newAPIExecutor(node)
api := newAPIExecutor(node, "test")
resp := api.Unsubscribe(context.Background(), &UnsubscribeRequest{})
assert.Equal(t, ErrorBadRequest, resp.Error)
resp = api.Unsubscribe(context.Background(), &UnsubscribeRequest{
Expand All @@ -148,14 +148,14 @@ func TestUnsubscribeAPI(t *testing.T) {

func TestChannelsAPI(t *testing.T) {
node := nodeWithMemoryEngine()
api := newAPIExecutor(node)
api := newAPIExecutor(node, "test")
resp := api.Channels(context.Background(), &ChannelsRequest{})
assert.Nil(t, resp.Error)
}

func TestInfoAPI(t *testing.T) {
node := nodeWithMemoryEngine()
api := newAPIExecutor(node)
api := newAPIExecutor(node, "test")
resp := api.Info(context.Background(), &InfoRequest{})
assert.Nil(t, resp.Error)
}

0 comments on commit b04a8f2

Please sign in to comment.