github.com/jcmturner/gokrb5/v8@v8.4.4/gssapi/gssapi_test.go (about)

     1  package gssapi
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/jcmturner/gofork/encoding/asn1"
     7  	"github.com/stretchr/testify/assert"
     8  )
     9  
    10  func TestOID(t *testing.T) {
    11  	var tests = []struct {
    12  		name OIDName
    13  		oid  []int
    14  	}{
    15  		{OIDMSLegacyKRB5, []int{1, 2, 840, 48018, 1, 2, 2}},
    16  		{OIDKRB5, []int{1, 2, 840, 113554, 1, 2, 2}},
    17  		{OIDSPNEGO, []int{1, 3, 6, 1, 5, 5, 2}},
    18  		{OIDGSSIAKerb, []int{1, 3, 6, 1, 5, 2, 5}},
    19  	}
    20  
    21  	for _, tst := range tests {
    22  		oid := asn1.ObjectIdentifier(tst.oid)
    23  		assert.True(t, oid.Equal(OIDName(tst.name).OID()), "OID value not as expected for %s", tst.name)
    24  	}
    25  }