2023-03-28 18:39:22 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
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
|
|
|
|
}
|