From 743c7f8aef28365f39a49293f978b55e1e339141 Mon Sep 17 00:00:00 2001 From: Chao Wang Date: Sat, 6 Oct 2018 18:48:13 -0400 Subject: [PATCH] Add mock for consumer message (#55) --- consumer/consumer_mock.go | 67 +++++++++++++++++++++++++++++++++++++ generated/mocks/generate.go | 1 + 2 files changed, 68 insertions(+) create mode 100644 consumer/consumer_mock.go diff --git a/consumer/consumer_mock.go b/consumer/consumer_mock.go new file mode 100644 index 0000000..670e399 --- /dev/null +++ b/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") +} diff --git a/generated/mocks/generate.go b/generated/mocks/generate.go index bb76add..6e72aa4 100644 --- a/generated/mocks/generate.go +++ b/generated/mocks/generate.go @@ -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).