File: routes_test.go

package info (click to toggle)
golang-github-rluisr-mysqlrouter-go 1.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 264 kB
  • sloc: sh: 215; javascript: 15; makefile: 11
file content (53 lines) | stat: -rw-r--r-- 1,022 bytes parent folder | download
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)
}