-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
routes_test.go
53 lines (39 loc) · 1022 Bytes
/
routes_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package mysqlrouter
import (
"testing"
"github.com/stretchr/testify/assert"
)
var (
route string
)
func TestClient_GetAllRoutes(t *testing.T) {
setupWithoutTLS()
routes, err := client.GetAllRoutes()
assert.NoError(t, err)
assert.NotEmpty(t, routes)
route = routes[1].Name
}
func TestClient_GetRouteStatus(t *testing.T) {
setupWithoutTLS()
_, err := client.GetRouteStatus(route)
assert.NoError(t, err)
// A newborn cluster has no route status.
//assert.NotEmpty(t, routeStatus)
}
func TestClient_GetRouteHealth(t *testing.T) {
setupWithoutTLS()
routeHealth, err := client.GetRouteHealth(route)
assert.NoError(t, err)
assert.NotEmpty(t, routeHealth)
}
func TestClient_GetRouteDestinations(t *testing.T) {
setupWithoutTLS()
routeDestinations, err := client.GetRouteDestinations(route)
assert.NoError(t, err)
assert.NotEmpty(t, routeDestinations)
}
func TestClient_GetRouteConnections(t *testing.T) {
setupWithoutTLS()
_, err := client.GetRouteConnections(route)
assert.NoError(t, err)
}