Create Alias Domain Object and Repo (#4275)
* Create alias domain object resource * Add paginated listing * fixing ratelimit related panics * Address reviewer comments * remove NewAlias value checks
This commit is contained in:
1 parent
7e2038bfcc
commit
e848e76b48
38 files changed
+3787
-5
No files matched your search
@@ -0,0 +1,38 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
package target_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
atar "github.com/hashicorp/boundary/internal/alias/target"
|
||||
"github.com/hashicorp/boundary/internal/db"
|
||||
"github.com/hashicorp/boundary/internal/iam"
|
||||
"github.com/hashicorp/boundary/internal/target/tcp"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestTestAlias(t *testing.T) {
|
||||
conn, _ := db.TestSetup(t, "postgres")
|
||||
rw := db.New(conn)
|
||||
wrapper := db.TestWrapper(t)
|
||||
iamRepo := iam.TestRepo(t, conn, wrapper)
|
||||
_, proj := iam.TestScopes(t, iamRepo)
|
||||
tar := tcp.TestTarget(context.Background(), t, conn, proj.GetPublicId(), "test target")
|
||||
|
||||
a := atar.TestAlias(t, rw, "example.alias",
|
||||
atar.WithDescription("description"),
|
||||
atar.WithName("name"),
|
||||
atar.WithDestinationId(tar.GetPublicId()),
|
||||
atar.WithHostId("hst_1234567890"))
|
||||
|
||||
assert.Equal(t, "example.alias", a.GetValue())
|
||||
assert.Equal(t, "description", a.GetDescription())
|
||||
assert.Equal(t, "name", a.GetName())
|
||||
assert.Equal(t, tar.GetPublicId(), a.GetDestinationId())
|
||||
assert.Equal(t, "hst_1234567890", a.GetHostId())
|
||||
assert.Equal(t, "global", a.GetScopeId())
|
||||
assert.NotEmpty(t, a.GetPublicId())
|
||||
}
|
||||
Reference in new issue
Block a user