go.temporal.io/server@v1.23.0/common/persistence/namespace_replication_queue_mock.go (about)

     1  // The MIT License
     2  //
     3  // Copyright (c) 2020 Temporal Technologies Inc.  All rights reserved.
     4  //
     5  // Copyright (c) 2020 Uber Technologies, Inc.
     6  //
     7  // Permission is hereby granted, free of charge, to any person obtaining a copy
     8  // of this software and associated documentation files (the "Software"), to deal
     9  // in the Software without restriction, including without limitation the rights
    10  // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    11  // copies of the Software, and to permit persons to whom the Software is
    12  // furnished to do so, subject to the following conditions:
    13  //
    14  // The above copyright notice and this permission notice shall be included in
    15  // all copies or substantial portions of the Software.
    16  //
    17  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    18  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    19  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    20  // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    21  // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    22  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    23  // THE SOFTWARE.
    24  
    25  // Code generated by MockGen. DO NOT EDIT.
    26  // Source: namespace_replication_queue.go
    27  
    28  // Package persistence is a generated GoMock package.
    29  package persistence
    30  
    31  import (
    32  	context "context"
    33  	reflect "reflect"
    34  
    35  	gomock "github.com/golang/mock/gomock"
    36  	repication "go.temporal.io/server/api/replication/v1"
    37  )
    38  
    39  // MockNamespaceReplicationQueue is a mock of NamespaceReplicationQueue interface.
    40  type MockNamespaceReplicationQueue struct {
    41  	ctrl     *gomock.Controller
    42  	recorder *MockNamespaceReplicationQueueMockRecorder
    43  }
    44  
    45  // MockNamespaceReplicationQueueMockRecorder is the mock recorder for MockNamespaceReplicationQueue.
    46  type MockNamespaceReplicationQueueMockRecorder struct {
    47  	mock *MockNamespaceReplicationQueue
    48  }
    49  
    50  // NewMockNamespaceReplicationQueue creates a new mock instance.
    51  func NewMockNamespaceReplicationQueue(ctrl *gomock.Controller) *MockNamespaceReplicationQueue {
    52  	mock := &MockNamespaceReplicationQueue{ctrl: ctrl}
    53  	mock.recorder = &MockNamespaceReplicationQueueMockRecorder{mock}
    54  	return mock
    55  }
    56  
    57  // EXPECT returns an object that allows the caller to indicate expected use.
    58  func (m *MockNamespaceReplicationQueue) EXPECT() *MockNamespaceReplicationQueueMockRecorder {
    59  	return m.recorder
    60  }
    61  
    62  // DeleteMessageFromDLQ mocks base method.
    63  func (m *MockNamespaceReplicationQueue) DeleteMessageFromDLQ(ctx context.Context, messageID int64) error {
    64  	m.ctrl.T.Helper()
    65  	ret := m.ctrl.Call(m, "DeleteMessageFromDLQ", ctx, messageID)
    66  	ret0, _ := ret[0].(error)
    67  	return ret0
    68  }
    69  
    70  // DeleteMessageFromDLQ indicates an expected call of DeleteMessageFromDLQ.
    71  func (mr *MockNamespaceReplicationQueueMockRecorder) DeleteMessageFromDLQ(ctx, messageID interface{}) *gomock.Call {
    72  	mr.mock.ctrl.T.Helper()
    73  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteMessageFromDLQ", reflect.TypeOf((*MockNamespaceReplicationQueue)(nil).DeleteMessageFromDLQ), ctx, messageID)
    74  }
    75  
    76  // GetAckLevels mocks base method.
    77  func (m *MockNamespaceReplicationQueue) GetAckLevels(ctx context.Context) (map[string]int64, error) {
    78  	m.ctrl.T.Helper()
    79  	ret := m.ctrl.Call(m, "GetAckLevels", ctx)
    80  	ret0, _ := ret[0].(map[string]int64)
    81  	ret1, _ := ret[1].(error)
    82  	return ret0, ret1
    83  }
    84  
    85  // GetAckLevels indicates an expected call of GetAckLevels.
    86  func (mr *MockNamespaceReplicationQueueMockRecorder) GetAckLevels(ctx interface{}) *gomock.Call {
    87  	mr.mock.ctrl.T.Helper()
    88  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAckLevels", reflect.TypeOf((*MockNamespaceReplicationQueue)(nil).GetAckLevels), ctx)
    89  }
    90  
    91  // GetDLQAckLevel mocks base method.
    92  func (m *MockNamespaceReplicationQueue) GetDLQAckLevel(ctx context.Context) (int64, error) {
    93  	m.ctrl.T.Helper()
    94  	ret := m.ctrl.Call(m, "GetDLQAckLevel", ctx)
    95  	ret0, _ := ret[0].(int64)
    96  	ret1, _ := ret[1].(error)
    97  	return ret0, ret1
    98  }
    99  
   100  // GetDLQAckLevel indicates an expected call of GetDLQAckLevel.
   101  func (mr *MockNamespaceReplicationQueueMockRecorder) GetDLQAckLevel(ctx interface{}) *gomock.Call {
   102  	mr.mock.ctrl.T.Helper()
   103  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDLQAckLevel", reflect.TypeOf((*MockNamespaceReplicationQueue)(nil).GetDLQAckLevel), ctx)
   104  }
   105  
   106  // GetMessagesFromDLQ mocks base method.
   107  func (m *MockNamespaceReplicationQueue) GetMessagesFromDLQ(ctx context.Context, firstMessageID, lastMessageID int64, pageSize int, pageToken []byte) ([]*repication.ReplicationTask, []byte, error) {
   108  	m.ctrl.T.Helper()
   109  	ret := m.ctrl.Call(m, "GetMessagesFromDLQ", ctx, firstMessageID, lastMessageID, pageSize, pageToken)
   110  	ret0, _ := ret[0].([]*repication.ReplicationTask)
   111  	ret1, _ := ret[1].([]byte)
   112  	ret2, _ := ret[2].(error)
   113  	return ret0, ret1, ret2
   114  }
   115  
   116  // GetMessagesFromDLQ indicates an expected call of GetMessagesFromDLQ.
   117  func (mr *MockNamespaceReplicationQueueMockRecorder) GetMessagesFromDLQ(ctx, firstMessageID, lastMessageID, pageSize, pageToken interface{}) *gomock.Call {
   118  	mr.mock.ctrl.T.Helper()
   119  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMessagesFromDLQ", reflect.TypeOf((*MockNamespaceReplicationQueue)(nil).GetMessagesFromDLQ), ctx, firstMessageID, lastMessageID, pageSize, pageToken)
   120  }
   121  
   122  // GetReplicationMessages mocks base method.
   123  func (m *MockNamespaceReplicationQueue) GetReplicationMessages(ctx context.Context, lastMessageID int64, maxCount int) ([]*repication.ReplicationTask, int64, error) {
   124  	m.ctrl.T.Helper()
   125  	ret := m.ctrl.Call(m, "GetReplicationMessages", ctx, lastMessageID, maxCount)
   126  	ret0, _ := ret[0].([]*repication.ReplicationTask)
   127  	ret1, _ := ret[1].(int64)
   128  	ret2, _ := ret[2].(error)
   129  	return ret0, ret1, ret2
   130  }
   131  
   132  // GetReplicationMessages indicates an expected call of GetReplicationMessages.
   133  func (mr *MockNamespaceReplicationQueueMockRecorder) GetReplicationMessages(ctx, lastMessageID, maxCount interface{}) *gomock.Call {
   134  	mr.mock.ctrl.T.Helper()
   135  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetReplicationMessages", reflect.TypeOf((*MockNamespaceReplicationQueue)(nil).GetReplicationMessages), ctx, lastMessageID, maxCount)
   136  }
   137  
   138  // Publish mocks base method.
   139  func (m *MockNamespaceReplicationQueue) Publish(ctx context.Context, task *repication.ReplicationTask) error {
   140  	m.ctrl.T.Helper()
   141  	ret := m.ctrl.Call(m, "Publish", ctx, task)
   142  	ret0, _ := ret[0].(error)
   143  	return ret0
   144  }
   145  
   146  // Publish indicates an expected call of Publish.
   147  func (mr *MockNamespaceReplicationQueueMockRecorder) Publish(ctx, task interface{}) *gomock.Call {
   148  	mr.mock.ctrl.T.Helper()
   149  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Publish", reflect.TypeOf((*MockNamespaceReplicationQueue)(nil).Publish), ctx, task)
   150  }
   151  
   152  // PublishToDLQ mocks base method.
   153  func (m *MockNamespaceReplicationQueue) PublishToDLQ(ctx context.Context, task *repication.ReplicationTask) error {
   154  	m.ctrl.T.Helper()
   155  	ret := m.ctrl.Call(m, "PublishToDLQ", ctx, task)
   156  	ret0, _ := ret[0].(error)
   157  	return ret0
   158  }
   159  
   160  // PublishToDLQ indicates an expected call of PublishToDLQ.
   161  func (mr *MockNamespaceReplicationQueueMockRecorder) PublishToDLQ(ctx, task interface{}) *gomock.Call {
   162  	mr.mock.ctrl.T.Helper()
   163  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PublishToDLQ", reflect.TypeOf((*MockNamespaceReplicationQueue)(nil).PublishToDLQ), ctx, task)
   164  }
   165  
   166  // RangeDeleteMessagesFromDLQ mocks base method.
   167  func (m *MockNamespaceReplicationQueue) RangeDeleteMessagesFromDLQ(ctx context.Context, firstMessageID, lastMessageID int64) error {
   168  	m.ctrl.T.Helper()
   169  	ret := m.ctrl.Call(m, "RangeDeleteMessagesFromDLQ", ctx, firstMessageID, lastMessageID)
   170  	ret0, _ := ret[0].(error)
   171  	return ret0
   172  }
   173  
   174  // RangeDeleteMessagesFromDLQ indicates an expected call of RangeDeleteMessagesFromDLQ.
   175  func (mr *MockNamespaceReplicationQueueMockRecorder) RangeDeleteMessagesFromDLQ(ctx, firstMessageID, lastMessageID interface{}) *gomock.Call {
   176  	mr.mock.ctrl.T.Helper()
   177  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RangeDeleteMessagesFromDLQ", reflect.TypeOf((*MockNamespaceReplicationQueue)(nil).RangeDeleteMessagesFromDLQ), ctx, firstMessageID, lastMessageID)
   178  }
   179  
   180  // Start mocks base method.
   181  func (m *MockNamespaceReplicationQueue) Start() {
   182  	m.ctrl.T.Helper()
   183  	m.ctrl.Call(m, "Start")
   184  }
   185  
   186  // Start indicates an expected call of Start.
   187  func (mr *MockNamespaceReplicationQueueMockRecorder) Start() *gomock.Call {
   188  	mr.mock.ctrl.T.Helper()
   189  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockNamespaceReplicationQueue)(nil).Start))
   190  }
   191  
   192  // Stop mocks base method.
   193  func (m *MockNamespaceReplicationQueue) Stop() {
   194  	m.ctrl.T.Helper()
   195  	m.ctrl.Call(m, "Stop")
   196  }
   197  
   198  // Stop indicates an expected call of Stop.
   199  func (mr *MockNamespaceReplicationQueueMockRecorder) Stop() *gomock.Call {
   200  	mr.mock.ctrl.T.Helper()
   201  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stop", reflect.TypeOf((*MockNamespaceReplicationQueue)(nil).Stop))
   202  }
   203  
   204  // UpdateAckLevel mocks base method.
   205  func (m *MockNamespaceReplicationQueue) UpdateAckLevel(ctx context.Context, lastProcessedMessageID int64, clusterName string) error {
   206  	m.ctrl.T.Helper()
   207  	ret := m.ctrl.Call(m, "UpdateAckLevel", ctx, lastProcessedMessageID, clusterName)
   208  	ret0, _ := ret[0].(error)
   209  	return ret0
   210  }
   211  
   212  // UpdateAckLevel indicates an expected call of UpdateAckLevel.
   213  func (mr *MockNamespaceReplicationQueueMockRecorder) UpdateAckLevel(ctx, lastProcessedMessageID, clusterName interface{}) *gomock.Call {
   214  	mr.mock.ctrl.T.Helper()
   215  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAckLevel", reflect.TypeOf((*MockNamespaceReplicationQueue)(nil).UpdateAckLevel), ctx, lastProcessedMessageID, clusterName)
   216  }
   217  
   218  // UpdateDLQAckLevel mocks base method.
   219  func (m *MockNamespaceReplicationQueue) UpdateDLQAckLevel(ctx context.Context, lastProcessedMessageID int64) error {
   220  	m.ctrl.T.Helper()
   221  	ret := m.ctrl.Call(m, "UpdateDLQAckLevel", ctx, lastProcessedMessageID)
   222  	ret0, _ := ret[0].(error)
   223  	return ret0
   224  }
   225  
   226  // UpdateDLQAckLevel indicates an expected call of UpdateDLQAckLevel.
   227  func (mr *MockNamespaceReplicationQueueMockRecorder) UpdateDLQAckLevel(ctx, lastProcessedMessageID interface{}) *gomock.Call {
   228  	mr.mock.ctrl.T.Helper()
   229  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDLQAckLevel", reflect.TypeOf((*MockNamespaceReplicationQueue)(nil).UpdateDLQAckLevel), ctx, lastProcessedMessageID)
   230  }