Skip to content
This repository has been archived by the owner on Oct 17, 2018. It is now read-only.

Commit

Permalink
Add mock for consumer message (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
cw9 committed Oct 6, 2018
1 parent ee298ef commit 743c7f8
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
67 changes: 67 additions & 0 deletions consumer/consumer_mock.go
@@ -0,0 +1,67 @@
// Copyright (c) 2018 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

// Automatically generated by MockGen. DO NOT EDIT!
// Source: github.com/m3db/m3msg/consumer (interfaces: Message)

package consumer

import (
"github.com/golang/mock/gomock"
)

// Mock of Message interface
type MockMessage struct {
ctrl *gomock.Controller
recorder *_MockMessageRecorder
}

// Recorder for MockMessage (not exported)
type _MockMessageRecorder struct {
mock *MockMessage
}

func NewMockMessage(ctrl *gomock.Controller) *MockMessage {
mock := &MockMessage{ctrl: ctrl}
mock.recorder = &_MockMessageRecorder{mock}
return mock
}

func (_m *MockMessage) EXPECT() *_MockMessageRecorder {
return _m.recorder
}

func (_m *MockMessage) Ack() {
_m.ctrl.Call(_m, "Ack")
}

func (_mr *_MockMessageRecorder) Ack() *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Ack")
}

func (_m *MockMessage) Bytes() []byte {
ret := _m.ctrl.Call(_m, "Bytes")
ret0, _ := ret[0].([]byte)
return ret0
}

func (_mr *_MockMessageRecorder) Bytes() *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Bytes")
}
1 change: 1 addition & 0 deletions generated/mocks/generate.go
Expand Up @@ -20,6 +20,7 @@

// mockgen rules for generating mocks for exported interfaces (reflection mode).
//go:generate sh -c "mockgen -package=producer $PACKAGE/producer Message,Producer | mockclean -pkg $PACKAGE/producer -out $GOPATH/src/$PACKAGE/producer/producer_mock.go"
//go:generate sh -c "mockgen -package=consumer $PACKAGE/consumer Message | mockclean -pkg $PACKAGE/consumer -out $GOPATH/src/$PACKAGE/consumer/consumer_mock.go"
//go:generate sh -c "mockgen -package=proto $PACKAGE/protocol/proto Encoder,Decoder | mockclean -pkg $PACKAGE/protocol/proto -out $GOPATH/src/$PACKAGE/protocol/proto/proto_mock.go"

// mockgen rules for generating mocks for unexported interfaces (file mode).
Expand Down

0 comments on commit 743c7f8

Please sign in to comment.