Files
threshold/internal/server/job/options_test.go
T

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

27 lines
768 B
Go
Raw Normal View History

2023-05-22 11:49:27 -04:00
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package servers
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func Test_GetOpts(t *testing.T) {
t.Parallel()
t.Run("WithRotationFrequency", func(t *testing.T) {
testOpts := getDefaultOptions()
assert.Equal(t, testOpts.withRotationFrequency, defaultRotationFrequency)
opts := getOpts(WithRotationFrequency(time.Minute))
assert.Equal(t, time.Minute, opts.withRotationFrequency)
})
t.Run("WithCertificateLifetime", func(t *testing.T) {
testOpts := getDefaultOptions()
assert.Equal(t, testOpts.withCertificateLifetime, time.Duration(0))
opts := getOpts(WithCertificateLifetime(time.Minute))
assert.Equal(t, time.Minute, opts.withCertificateLifetime)
})
}