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