Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use default kazoo-go #144

Merged
merged 1 commit into from
Sep 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 60 additions & 90 deletions examples/testing/context_mock.go
Original file line number Diff line number Diff line change
@@ -1,181 +1,151 @@
// Code generated by MockGen. DO NOT EDIT.
// Automatically generated by MockGen. DO NOT EDIT!
// Source: github.com/lovoo/goka (interfaces: Context)

// Package main is a generated GoMock package.
package main

import (
gomock "github.com/golang/mock/gomock"
goka "github.com/lovoo/goka"
reflect "reflect"
time "time"
)

// MockContext is a mock of Context interface
// Mock of Context interface
type MockContext struct {
ctrl *gomock.Controller
recorder *MockContextMockRecorder
recorder *_MockContextRecorder
}

// MockContextMockRecorder is the mock recorder for MockContext
type MockContextMockRecorder struct {
// Recorder for MockContext (not exported)
type _MockContextRecorder struct {
mock *MockContext
}

// NewMockContext creates a new mock instance
func NewMockContext(ctrl *gomock.Controller) *MockContext {
mock := &MockContext{ctrl: ctrl}
mock.recorder = &MockContextMockRecorder{mock}
mock.recorder = &_MockContextRecorder{mock}
return mock
}

// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockContext) EXPECT() *MockContextMockRecorder {
return m.recorder
func (_m *MockContext) EXPECT() *_MockContextRecorder {
return _m.recorder
}

// Delete mocks base method
func (m *MockContext) Delete() {
m.ctrl.Call(m, "Delete")
func (_m *MockContext) Delete() {
_m.ctrl.Call(_m, "Delete")
}

// Delete indicates an expected call of Delete
func (mr *MockContextMockRecorder) Delete() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockContext)(nil).Delete))
func (_mr *_MockContextRecorder) Delete() *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Delete")
}

// Emit mocks base method
func (m *MockContext) Emit(arg0 goka.Stream, arg1 string, arg2 interface{}) {
m.ctrl.Call(m, "Emit", arg0, arg1, arg2)
func (_m *MockContext) Emit(_param0 goka.Stream, _param1 string, _param2 interface{}) {
_m.ctrl.Call(_m, "Emit", _param0, _param1, _param2)
}

// Emit indicates an expected call of Emit
func (mr *MockContextMockRecorder) Emit(arg0, arg1, arg2 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Emit", reflect.TypeOf((*MockContext)(nil).Emit), arg0, arg1, arg2)
func (_mr *_MockContextRecorder) Emit(arg0, arg1, arg2 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Emit", arg0, arg1, arg2)
}

// Fail mocks base method
func (m *MockContext) Fail(arg0 error) {
m.ctrl.Call(m, "Fail", arg0)
func (_m *MockContext) Fail(_param0 error) {
_m.ctrl.Call(_m, "Fail", _param0)
}

// Fail indicates an expected call of Fail
func (mr *MockContextMockRecorder) Fail(arg0 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Fail", reflect.TypeOf((*MockContext)(nil).Fail), arg0)
func (_mr *_MockContextRecorder) Fail(arg0 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Fail", arg0)
}

// Join mocks base method
func (m *MockContext) Join(arg0 goka.Table) interface{} {
ret := m.ctrl.Call(m, "Join", arg0)
func (_m *MockContext) Join(_param0 goka.Table) interface{} {
ret := _m.ctrl.Call(_m, "Join", _param0)
ret0, _ := ret[0].(interface{})
return ret0
}

// Join indicates an expected call of Join
func (mr *MockContextMockRecorder) Join(arg0 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Join", reflect.TypeOf((*MockContext)(nil).Join), arg0)
func (_mr *_MockContextRecorder) Join(arg0 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Join", arg0)
}

// Key mocks base method
func (m *MockContext) Key() string {
ret := m.ctrl.Call(m, "Key")
func (_m *MockContext) Key() string {
ret := _m.ctrl.Call(_m, "Key")
ret0, _ := ret[0].(string)
return ret0
}

// Key indicates an expected call of Key
func (mr *MockContextMockRecorder) Key() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Key", reflect.TypeOf((*MockContext)(nil).Key))
func (_mr *_MockContextRecorder) Key() *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Key")
}

// Lookup mocks base method
func (m *MockContext) Lookup(arg0 goka.Table, arg1 string) interface{} {
ret := m.ctrl.Call(m, "Lookup", arg0, arg1)
func (_m *MockContext) Lookup(_param0 goka.Table, _param1 string) interface{} {
ret := _m.ctrl.Call(_m, "Lookup", _param0, _param1)
ret0, _ := ret[0].(interface{})
return ret0
}

// Lookup indicates an expected call of Lookup
func (mr *MockContextMockRecorder) Lookup(arg0, arg1 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Lookup", reflect.TypeOf((*MockContext)(nil).Lookup), arg0, arg1)
func (_mr *_MockContextRecorder) Lookup(arg0, arg1 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Lookup", arg0, arg1)
}

// Loopback mocks base method
func (m *MockContext) Loopback(arg0 string, arg1 interface{}) {
m.ctrl.Call(m, "Loopback", arg0, arg1)
func (_m *MockContext) Loopback(_param0 string, _param1 interface{}) {
_m.ctrl.Call(_m, "Loopback", _param0, _param1)
}

// Loopback indicates an expected call of Loopback
func (mr *MockContextMockRecorder) Loopback(arg0, arg1 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Loopback", reflect.TypeOf((*MockContext)(nil).Loopback), arg0, arg1)
func (_mr *_MockContextRecorder) Loopback(arg0, arg1 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Loopback", arg0, arg1)
}

// Offset mocks base method
func (m *MockContext) Offset() int64 {
ret := m.ctrl.Call(m, "Offset")
func (_m *MockContext) Offset() int64 {
ret := _m.ctrl.Call(_m, "Offset")
ret0, _ := ret[0].(int64)
return ret0
}

// Offset indicates an expected call of Offset
func (mr *MockContextMockRecorder) Offset() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Offset", reflect.TypeOf((*MockContext)(nil).Offset))
func (_mr *_MockContextRecorder) Offset() *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Offset")
}

// Partition mocks base method
func (m *MockContext) Partition() int32 {
ret := m.ctrl.Call(m, "Partition")
func (_m *MockContext) Partition() int32 {
ret := _m.ctrl.Call(_m, "Partition")
ret0, _ := ret[0].(int32)
return ret0
}

// Partition indicates an expected call of Partition
func (mr *MockContextMockRecorder) Partition() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Partition", reflect.TypeOf((*MockContext)(nil).Partition))
func (_mr *_MockContextRecorder) Partition() *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Partition")
}

// SetValue mocks base method
func (m *MockContext) SetValue(arg0 interface{}) {
m.ctrl.Call(m, "SetValue", arg0)
func (_m *MockContext) SetValue(_param0 interface{}) {
_m.ctrl.Call(_m, "SetValue", _param0)
}

// SetValue indicates an expected call of SetValue
func (mr *MockContextMockRecorder) SetValue(arg0 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetValue", reflect.TypeOf((*MockContext)(nil).SetValue), arg0)
func (_mr *_MockContextRecorder) SetValue(arg0 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "SetValue", arg0)
}

// Timestamp mocks base method
func (m *MockContext) Timestamp() time.Time {
ret := m.ctrl.Call(m, "Timestamp")
func (_m *MockContext) Timestamp() time.Time {
ret := _m.ctrl.Call(_m, "Timestamp")
ret0, _ := ret[0].(time.Time)
return ret0
}

// Timestamp indicates an expected call of Timestamp
func (mr *MockContextMockRecorder) Timestamp() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Timestamp", reflect.TypeOf((*MockContext)(nil).Timestamp))
func (_mr *_MockContextRecorder) Timestamp() *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Timestamp")
}

// Topic mocks base method
func (m *MockContext) Topic() goka.Stream {
ret := m.ctrl.Call(m, "Topic")
func (_m *MockContext) Topic() goka.Stream {
ret := _m.ctrl.Call(_m, "Topic")
ret0, _ := ret[0].(goka.Stream)
return ret0
}

// Topic indicates an expected call of Topic
func (mr *MockContextMockRecorder) Topic() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Topic", reflect.TypeOf((*MockContext)(nil).Topic))
func (_mr *_MockContextRecorder) Topic() *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Topic")
}

// Value mocks base method
func (m *MockContext) Value() interface{} {
ret := m.ctrl.Call(m, "Value")
func (_m *MockContext) Value() interface{} {
ret := _m.ctrl.Call(_m, "Value")
ret0, _ := ret[0].(interface{})
return ret0
}

// Value indicates an expected call of Value
func (mr *MockContextMockRecorder) Value() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Value", reflect.TypeOf((*MockContext)(nil).Value))
func (_mr *_MockContextRecorder) Value() *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Value")
}
2 changes: 1 addition & 1 deletion kafka/mock/kazoo.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
package mock

import (
kazoo_go "github.com/db7/kazoo-go"
gomock "github.com/golang/mock/gomock"
kazoo_go "github.com/wvanbergen/kazoo-go"
)

// Mock of TopicManager interface
Expand Down
2 changes: 1 addition & 1 deletion kafka/topic_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

"github.com/Shopify/sarama"
kazoo "github.com/db7/kazoo-go"
kazoo "github.com/wvanbergen/kazoo-go"
)

// TopicManager provides an interface to create/check topics and their partitions
Expand Down
2 changes: 1 addition & 1 deletion kafka/topic_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/lovoo/goka/kafka/mock"

kazoo "github.com/db7/kazoo-go"
"github.com/facebookgo/ensure"
"github.com/golang/mock/gomock"
kazoo "github.com/wvanbergen/kazoo-go"
)

func TestTopicManager_updateChroot(t *testing.T) {
Expand Down