2023-03-28 19:39:22 +01:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-11 09:12:13 -04:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-03-28 19:39:22 +01:00
|
|
|
|
2018-03-09 17:16:12 -08:00
|
|
|
package structs
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/mitchellh/go-testing-interface"
|
|
|
|
)
|
|
|
|
|
2018-05-04 14:10:03 -07:00
|
|
|
// TestServiceDefinition returns a ServiceDefinition for a typical service.
|
|
|
|
func TestServiceDefinition(t testing.T) *ServiceDefinition {
|
|
|
|
return &ServiceDefinition{
|
|
|
|
Name: "db",
|
2018-09-12 17:07:47 +01:00
|
|
|
Port: 1234,
|
2018-05-04 14:10:03 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-09 17:16:12 -08:00
|
|
|
// TestServiceDefinitionProxy returns a ServiceDefinition for a proxy.
|
|
|
|
func TestServiceDefinitionProxy(t testing.T) *ServiceDefinition {
|
|
|
|
return &ServiceDefinition{
|
2018-09-12 17:07:47 +01:00
|
|
|
Kind: ServiceKindConnectProxy,
|
|
|
|
Name: "foo-proxy",
|
|
|
|
Port: 1234,
|
|
|
|
Proxy: &ConnectProxyConfig{
|
|
|
|
DestinationServiceName: "db",
|
|
|
|
},
|
2018-03-09 17:16:12 -08:00
|
|
|
}
|
|
|
|
}
|