Files
threshold/internal/kms/job/job_test.go
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
822 B
Go
Raw Normal View History

2022-11-16 17:17:28 -06:00
// Copyright (c) HashiCorp, Inc.
2023-02-02 17:15:17 -08:00
// SPDX-License-Identifier: BUSL-1.1
2022-11-16 17:17:28 -06:00
package job
import (
"context"
"testing"
"github.com/hashicorp/boundary/internal/db"
"github.com/hashicorp/boundary/internal/kms"
"github.com/hashicorp/boundary/internal/scheduler"
"github.com/stretchr/testify/require"
)
func Test_RegisterJobs(t *testing.T) {
conn, _ := db.TestSetup(t, "postgres")
extWrapper := db.TestWrapper(t)
kmsCache := kms.TestKms(t, conn, extWrapper)
s := scheduler.TestScheduler(t, conn, extWrapper)
err := RegisterJobs(context.Background(), nil, nil)
require.Error(t, err)
err = RegisterJobs(context.Background(), s, nil)
require.Error(t, err)
err = RegisterJobs(context.Background(), nil, kmsCache)
require.Error(t, err)
err = RegisterJobs(context.Background(), s, kmsCache)
require.NoError(t, err)
}