github.com/sl1pm4t/consul@v1.4.5-0.20190325224627-74c31c540f9c/agent/local/testing.go (about)

     1  package local
     2  
     3  import (
     4  	"log"
     5  	"os"
     6  
     7  	"github.com/hashicorp/consul/agent/token"
     8  	"github.com/mitchellh/go-testing-interface"
     9  )
    10  
    11  // TestState returns a configured *State for testing.
    12  func TestState(t testing.T) *State {
    13  	result := NewState(Config{
    14  		ProxyBindMinPort: 20000,
    15  		ProxyBindMaxPort: 20500,
    16  	}, log.New(os.Stderr, "", log.LstdFlags), &token.Store{})
    17  	result.TriggerSyncChanges = func() {}
    18  	return result
    19  }