2018-03-07 01:32:41 +00:00
|
|
|
package structs
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/mitchellh/go-testing-interface"
|
|
|
|
)
|
|
|
|
|
|
|
|
// TestRegisterRequestProxy returns a RegisterRequest for registering a
|
|
|
|
// Connect proxy.
|
|
|
|
func TestRegisterRequestProxy(t testing.T) *RegisterRequest {
|
|
|
|
return &RegisterRequest{
|
|
|
|
Datacenter: "dc1",
|
|
|
|
Node: "foo",
|
|
|
|
Address: "127.0.0.1",
|
2018-03-09 06:13:35 +00:00
|
|
|
Service: TestNodeServiceProxy(t),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// TestNodeServiceProxy returns a *NodeService representing a valid
|
|
|
|
// Connect proxy.
|
|
|
|
func TestNodeServiceProxy(t testing.T) *NodeService {
|
|
|
|
return &NodeService{
|
|
|
|
Kind: ServiceKindConnectProxy,
|
|
|
|
Service: ConnectProxyServiceName,
|
|
|
|
Address: "127.0.0.2",
|
|
|
|
Port: 2222,
|
|
|
|
ProxyDestination: "web",
|
2018-03-07 01:32:41 +00:00
|
|
|
}
|
|
|
|
}
|