Documentation ¶
Overview ¶
Package throttlerclienttest contains the testsuite against which each RPC implementation of the throttlerclient interface must be tested.
Index ¶
- func TestSuite(t *testing.T, c throttlerclient.Client)
- func TestSuitePanics(t *testing.T, c throttlerclient.Client)
- type FakeManager
- func (fm *FakeManager) GetConfiguration(throttlerName string) (map[string]*throttlerdata.Configuration, error)
- func (fm *FakeManager) MaxRates() map[string]int64
- func (fm *FakeManager) ResetConfiguration(throttlerName string) ([]string, error)
- func (fm *FakeManager) SetMaxRate(int64) []string
- func (fm *FakeManager) UpdateConfiguration(throttlerName string, configuration *throttlerdata.Configuration, ...) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestSuite ¶
func TestSuite(t *testing.T, c throttlerclient.Client)
TestSuite runs the test suite on the given throttlerclient and throttlerserver.
func TestSuitePanics ¶
func TestSuitePanics(t *testing.T, c throttlerclient.Client)
TestSuitePanics tests the panic handling of each RPC method. Unlike TestSuite it does not use the real throttler.managerImpl. Instead, it uses FakeManager which allows us to panic on each RPC.
Types ¶
type FakeManager ¶
type FakeManager struct { }
FakeManager implements the throttler.Manager interface and panics on all methods defined in the interface.
func (*FakeManager) GetConfiguration ¶
func (fm *FakeManager) GetConfiguration(throttlerName string) (map[string]*throttlerdata.Configuration, error)
GetConfiguration implements the throttler.Manager interface. It always panics.
func (*FakeManager) MaxRates ¶
func (fm *FakeManager) MaxRates() map[string]int64
MaxRates implements the throttler.Manager interface. It always panics.
func (*FakeManager) ResetConfiguration ¶
func (fm *FakeManager) ResetConfiguration(throttlerName string) ([]string, error)
ResetConfiguration implements the throttler.Manager interface. It always panics.
func (*FakeManager) SetMaxRate ¶
func (fm *FakeManager) SetMaxRate(int64) []string
SetMaxRate implements the throttler.Manager interface. It always panics.
func (*FakeManager) UpdateConfiguration ¶
func (fm *FakeManager) UpdateConfiguration(throttlerName string, configuration *throttlerdata.Configuration, copyZeroValues bool) ([]string, error)
UpdateConfiguration implements the throttler.Manager interface. It always panics.