github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/nomad/structs/connect_test.go (about) 1 package structs 2 3 import ( 4 "testing" 5 6 "github.com/hashicorp/nomad/ci" 7 "github.com/stretchr/testify/require" 8 ) 9 10 func TestTaskKind_IsAnyConnectGateway(t *testing.T) { 11 ci.Parallel(t) 12 13 t.Run("gateways", func(t *testing.T) { 14 require.True(t, NewTaskKind(ConnectIngressPrefix, "foo").IsAnyConnectGateway()) 15 require.True(t, NewTaskKind(ConnectTerminatingPrefix, "foo").IsAnyConnectGateway()) 16 require.True(t, NewTaskKind(ConnectMeshPrefix, "foo").IsAnyConnectGateway()) 17 }) 18 19 t.Run("not gateways", func(t *testing.T) { 20 require.False(t, NewTaskKind(ConnectProxyPrefix, "foo").IsAnyConnectGateway()) 21 require.False(t, NewTaskKind(ConnectNativePrefix, "foo").IsAnyConnectGateway()) 22 require.False(t, NewTaskKind("", "foo").IsAnyConnectGateway()) 23 }) 24 }