Files
threshold/internal/daemon/worker/proxy/options_test.go
T
Louis RuchandJeff Mitchell a17e973712 feat(credentials): Refactor credential purposes (#2260)
* feat(credentials): Refactor credential purposes

 * Application credentials have been refactored to Brokered credentials
 * Egress credentials have been refactored to Injected Application
credentials

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2022-07-19 15:16:24 -07:00

30 lines
757 B
Go

package proxy
import (
"testing"
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)
c := &serverpb.Credential{
Credential: &serverpb.Credential_UsernamePassword{
UsernamePassword: &serverpb.UsernamePassword{
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)
})
}