2021-09-08 10:06:38 -07:00
|
|
|
package host
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
|
|
"github.com/hashicorp/boundary/internal/db"
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
|
)
|
|
|
|
|
|
2022-04-25 15:52:44 -04:00
|
|
|
func TestPlugin(t testing.TB, conn *db.DB, name string) *Plugin {
|
2021-09-08 10:06:38 -07:00
|
|
|
t.Helper()
|
2021-09-24 13:16:13 -07:00
|
|
|
p := NewPlugin(WithName(name))
|
2021-09-08 10:06:38 -07:00
|
|
|
id, err := newPluginId()
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
p.PublicId = id
|
|
|
|
|
|
|
|
|
|
w := db.New(conn)
|
|
|
|
|
require.NoError(t, w.Create(context.Background(), p))
|
|
|
|
|
return p
|
|
|
|
|
}
|