testutil: Use HTTPAddr
This commit is contained in:
parent
41efd8861a
commit
73a2799b0d
|
@ -33,7 +33,7 @@ func makeClientWithConfig(
|
||||||
|
|
||||||
// Create server
|
// Create server
|
||||||
server := testutil.NewTestServerConfig(t, cb2)
|
server := testutil.NewTestServerConfig(t, cb2)
|
||||||
conf.Address = server.APIAddr
|
conf.Address = server.HTTPAddr
|
||||||
|
|
||||||
// Create client
|
// Create client
|
||||||
client, err := NewClient(conf)
|
client, err := NewClient(conf)
|
||||||
|
|
|
@ -97,10 +97,10 @@ type TestCheck struct {
|
||||||
|
|
||||||
// TestServer is the main server wrapper struct.
|
// TestServer is the main server wrapper struct.
|
||||||
type TestServer struct {
|
type TestServer struct {
|
||||||
PID int
|
PID int
|
||||||
Config *TestServerConfig
|
Config *TestServerConfig
|
||||||
APIAddr string
|
HTTPAddr string
|
||||||
t *testing.T
|
t *testing.T
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewTestServer is an easy helper method to create a new Consul
|
// NewTestServer is an easy helper method to create a new Consul
|
||||||
|
@ -153,10 +153,10 @@ func NewTestServerConfig(t *testing.T, cb ServerConfigCallback) *TestServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
server := &TestServer{
|
server := &TestServer{
|
||||||
Config: consulConfig,
|
Config: consulConfig,
|
||||||
PID: cmd.Process.Pid,
|
PID: cmd.Process.Pid,
|
||||||
APIAddr: fmt.Sprintf("127.0.0.1:%d", consulConfig.Ports.HTTP),
|
HTTPAddr: fmt.Sprintf("127.0.0.1:%d", consulConfig.Ports.HTTP),
|
||||||
t: t,
|
t: t,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait for the server to be ready
|
// Wait for the server to be ready
|
||||||
|
|
Loading…
Reference in New Issue