func (m Mock) PutState(update DomainState) error {
	if m.state.FailCalls == true {
		return errors.New("forced failure")
	}
	m.ds[update.Name] = update
	return nil
}
PutState mock method
package database
import "errors"
type Mock struct {
	ds map[string]DomainState
	state *MockController
}
type MockController struct {
	FailCalls bool
}
func NewMock() (m Mock, mc *MockController) {
	mc = &MockController{}
	m = Mock{
		ds:    map[string]DomainState{},
		state: mc,
	}
	return m, mc
}
func (m Mock) PutStates(updates []DomainState, logf func(format string, args ...interface{})) error {
	if m.state.FailCalls == true {
		return errors.New("forced failure")
	}
	for _, s := range updates {
		m.PutState(s)
	}
	return nil
}