2023-03-28 18:39:22 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-11 13:12:13 +00:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-03-28 18:39:22 +00:00
|
|
|
|
2018-05-01 06:35:23 +00:00
|
|
|
package local
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/hashicorp/consul/agent/token"
|
2020-01-28 23:50:41 +00:00
|
|
|
"github.com/hashicorp/go-hclog"
|
2018-05-01 06:35:23 +00:00
|
|
|
"github.com/mitchellh/go-testing-interface"
|
|
|
|
)
|
|
|
|
|
|
|
|
// TestState returns a configured *State for testing.
|
2020-11-05 16:18:59 +00:00
|
|
|
func TestState(_ testing.T) *State {
|
2020-01-28 23:50:41 +00:00
|
|
|
logger := hclog.New(&hclog.LoggerOptions{
|
|
|
|
Output: os.Stderr,
|
|
|
|
})
|
|
|
|
|
|
|
|
result := NewState(Config{}, logger, &token.Store{})
|
2018-05-01 06:35:23 +00:00
|
|
|
result.TriggerSyncChanges = func() {}
|
|
|
|
return result
|
|
|
|
}
|