You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
boundary/internal/plugin/host/testing.go

22 lines
398 B

package host
import (
"context"
"testing"
"github.com/hashicorp/boundary/internal/db"
"github.com/stretchr/testify/require"
)
func TestPlugin(t testing.TB, conn *db.DB, name string) *Plugin {
t.Helper()
p := NewPlugin(WithName(name))
id, err := newPluginId()
require.NoError(t, err)
p.PublicId = id
w := db.New(conn)
require.NoError(t, w.Create(context.Background(), p))
return p
}