(t *testing.T)
| 1220 | } |
| 1221 | |
| 1222 | func TestNoEchoOldServer(t *testing.T) { |
| 1223 | opts := GetDefaultOptions() |
| 1224 | opts.Url = DefaultURL |
| 1225 | opts.NoEcho = true |
| 1226 | |
| 1227 | nc := &Conn{Opts: opts} |
| 1228 | if err := nc.setupServerPool(); err != nil { |
| 1229 | t.Fatalf("Problem setting up Server Pool: %v\n", err) |
| 1230 | } |
| 1231 | |
| 1232 | // Old style with no proto, meaning 0. We need Proto:1 for NoEcho support. |
| 1233 | oldInfo := "{\"server_id\":\"22\",\"version\":\"1.1.0\",\"go\":\"go1.10.2\",\"port\":4222,\"max_payload\":1048576}" |
| 1234 | |
| 1235 | err := nc.processInfo(oldInfo) |
| 1236 | if err != nil { |
| 1237 | t.Fatalf("Error processing old style INFO: %v\n", err) |
| 1238 | } |
| 1239 | |
| 1240 | // Make sure connectProto generates an error. |
| 1241 | _, err = nc.connectProto() |
| 1242 | if err == nil { |
| 1243 | t.Fatalf("Expected an error but got none\n") |
| 1244 | } |
| 1245 | } |
| 1246 | |
| 1247 | func TestExpiredAuthentication(t *testing.T) { |
| 1248 | // The goal of these tests was to check how a client with an expiring JWT |
nothing calls this directly
no test coverage detected