github.com/hernad/nomad@v1.6.112/e2e/connect/acls_test.go (about)

     1  // Copyright (c) HashiCorp, Inc.
     2  // SPDX-License-Identifier: MPL-2.0
     3  
     4  package connect
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/stretchr/testify/require"
    10  )
    11  
    12  func Test_serviceOfSIToken(t *testing.T) {
    13  	try := func(description, exp string) {
    14  		tc := new(ConnectACLsE2ETest)
    15  		result := tc.serviceofSIToken(description)
    16  		require.Equal(t, exp, result)
    17  	}
    18  
    19  	try("", "")
    20  	try("foobarbaz", "")
    21  	try("_nomad_si [8b1a5d3f-7e61-4a5a-8a57-7e7ad91e63b6] [8b1a5d3f-7e61-4a5a-8a57-7e7ad91e63b6] [foo-service]", "foo-service")
    22  }