Files
threshold/internal/daemon/worker/proxy/options_test.go
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
757 B
Go
Raw Normal View History

package proxy
import (
"testing"
2021-12-17 11:26:42 -08:00
serverpb "github.com/hashicorp/boundary/internal/gen/controller/servers/services"
"github.com/stretchr/testify/assert"
)
func Test_GetOpts(t *testing.T) {
t.Parallel()
t.Run("WithInjectedApplicationCredentials", func(t *testing.T) {
assert := assert.New(t)
2021-12-17 11:26:42 -08:00
c := &serverpb.Credential{
Credential: &serverpb.Credential_UsernamePassword{
UsernamePassword: &serverpb.UsernamePassword{
2021-12-17 11:26:42 -08:00
Username: "user",
Password: "pass",
},
},
}
opts := GetOpts(WithInjectedApplicationCredentials([]*serverpb.Credential{c}))
testOpts := getDefaultOptions()
assert.NotEqual(opts, testOpts)
testOpts.WithInjectedApplicationCredentials = []*serverpb.Credential{c}
assert.Equal(opts, testOpts)
})
}