Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
256dpi committed Apr 29, 2018
1 parent a722353 commit 2c45787
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestClientConnectWrongKeepAlive(t *testing.T) {

// wrong keep alive
connectFuture, err := c.Connect(&Config{
BrokerURL: "mqtt://localhost:1234",
BrokerURL: "mqtt://localhost:1234567",
KeepAlive: "foo",
CleanSession: true,
})
Expand All @@ -45,7 +45,7 @@ func TestClientConnectErrorWrongPort(t *testing.T) {
c.Callback = errorCallback(t)

// wrong port
connectFuture, err := c.Connect(NewConfig("mqtt://localhost:1234"))
connectFuture, err := c.Connect(NewConfig("mqtt://localhost:1234567"))
assert.Error(t, err)
assert.Nil(t, connectFuture)
}
Expand All @@ -54,8 +54,12 @@ func TestClientConnectErrorMissingClientID(t *testing.T) {
c := New()
c.Callback = errorCallback(t)

// prepare config
cfg := NewConfig("tcp://localhost:1234")
cfg.CleanSession = false

// missing clientID when clean=false
connectFuture, err := c.Connect(NewConfig("mqtt://localhost:1234"))
connectFuture, err := c.Connect(cfg)
assert.Error(t, err)
assert.Nil(t, connectFuture)
}
Expand Down

0 comments on commit 2c45787

Please sign in to comment.