2020-07-24 10:23:35 -04:00
|
|
|
package password
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"strings"
|
|
|
|
|
"testing"
|
|
|
|
|
|
2021-06-08 11:31:58 -05:00
|
|
|
"github.com/hashicorp/boundary/internal/intglobals"
|
2020-07-24 10:23:35 -04:00
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func Test_PublicIds(t *testing.T) {
|
|
|
|
|
t.Run("authMethod", func(t *testing.T) {
|
|
|
|
|
id, err := newAuthMethodId()
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
assert.True(t, strings.HasPrefix(id, AuthMethodPrefix+"_"))
|
|
|
|
|
})
|
|
|
|
|
t.Run("account", func(t *testing.T) {
|
|
|
|
|
id, err := newAccountId()
|
|
|
|
|
require.NoError(t, err)
|
2021-06-08 11:31:58 -05:00
|
|
|
assert.True(t, strings.HasPrefix(id, intglobals.NewPasswordAccountPrefix+"_"))
|
2020-07-24 10:23:35 -04:00
|
|
|
})
|
|
|
|
|
}
|