statemachine_test.go 325 B

12345678910111213141516171819
  1. package raft
  2. import (
  3. "github.com/stretchr/testify/mock"
  4. )
  5. type mockStateMachine struct {
  6. mock.Mock
  7. }
  8. func (m *mockStateMachine) Save() ([]byte, error) {
  9. args := m.Called()
  10. return args.Get(0).([]byte), args.Error(1)
  11. }
  12. func (m *mockStateMachine) Recovery(b []byte) error {
  13. args := m.Called(b)
  14. return args.Error(0)
  15. }