Fix HTTPRoute and TCPRoute expectation for enterprise metadata (#16322)

This commit is contained in:
Andrew Stucki 2023-02-17 17:28:49 -05:00 committed by GitHub
parent 7552e84718
commit c430f45973
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -3,6 +3,7 @@ package structs
import (
"testing"
"github.com/hashicorp/consul/acl"
"github.com/stretchr/testify/require"
)
@ -36,8 +37,9 @@ func TestTCPRoute(t *testing.T) {
normalizeOnly: true,
check: func(t *testing.T, entry ConfigEntry) {
expectedParent := ResourceReference{
Kind: APIGateway,
Name: "gateway",
Kind: APIGateway,
Name: "gateway",
EnterpriseMeta: *acl.DefaultEnterpriseMeta(),
}
route := entry.(*TCPRouteConfigEntry)
require.Len(t, route.Parents, 1)
@ -74,8 +76,9 @@ func TestHTTPRoute(t *testing.T) {
normalizeOnly: true,
check: func(t *testing.T, entry ConfigEntry) {
expectedParent := ResourceReference{
Kind: APIGateway,
Name: "gateway",
Kind: APIGateway,
Name: "gateway",
EnterpriseMeta: *acl.DefaultEnterpriseMeta(),
}
route := entry.(*HTTPRouteConfigEntry)
require.Len(t, route.Parents, 1)