go.temporal.io/server@v1.23.0/common/authorization/authorizer_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: authorizer.go 27 28 // Package authorization is a generated GoMock package. 29 package authorization 30 31 import ( 32 context "context" 33 reflect "reflect" 34 35 gomock "github.com/golang/mock/gomock" 36 ) 37 38 // MockAuthorizer is a mock of Authorizer interface. 39 type MockAuthorizer struct { 40 ctrl *gomock.Controller 41 recorder *MockAuthorizerMockRecorder 42 } 43 44 // MockAuthorizerMockRecorder is the mock recorder for MockAuthorizer. 45 type MockAuthorizerMockRecorder struct { 46 mock *MockAuthorizer 47 } 48 49 // NewMockAuthorizer creates a new mock instance. 50 func NewMockAuthorizer(ctrl *gomock.Controller) *MockAuthorizer { 51 mock := &MockAuthorizer{ctrl: ctrl} 52 mock.recorder = &MockAuthorizerMockRecorder{mock} 53 return mock 54 } 55 56 // EXPECT returns an object that allows the caller to indicate expected use. 57 func (m *MockAuthorizer) EXPECT() *MockAuthorizerMockRecorder { 58 return m.recorder 59 } 60 61 // Authorize mocks base method. 62 func (m *MockAuthorizer) Authorize(ctx context.Context, caller *Claims, target *CallTarget) (Result, error) { 63 m.ctrl.T.Helper() 64 ret := m.ctrl.Call(m, "Authorize", ctx, caller, target) 65 ret0, _ := ret[0].(Result) 66 ret1, _ := ret[1].(error) 67 return ret0, ret1 68 } 69 70 // Authorize indicates an expected call of Authorize. 71 func (mr *MockAuthorizerMockRecorder) Authorize(ctx, caller, target interface{}) *gomock.Call { 72 mr.mock.ctrl.T.Helper() 73 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Authorize", reflect.TypeOf((*MockAuthorizer)(nil).Authorize), ctx, caller, target) 74 } 75 76 // MockhasNamespace is a mock of hasNamespace interface. 77 type MockhasNamespace struct { 78 ctrl *gomock.Controller 79 recorder *MockhasNamespaceMockRecorder 80 } 81 82 // MockhasNamespaceMockRecorder is the mock recorder for MockhasNamespace. 83 type MockhasNamespaceMockRecorder struct { 84 mock *MockhasNamespace 85 } 86 87 // NewMockhasNamespace creates a new mock instance. 88 func NewMockhasNamespace(ctrl *gomock.Controller) *MockhasNamespace { 89 mock := &MockhasNamespace{ctrl: ctrl} 90 mock.recorder = &MockhasNamespaceMockRecorder{mock} 91 return mock 92 } 93 94 // EXPECT returns an object that allows the caller to indicate expected use. 95 func (m *MockhasNamespace) EXPECT() *MockhasNamespaceMockRecorder { 96 return m.recorder 97 } 98 99 // GetNamespace mocks base method. 100 func (m *MockhasNamespace) GetNamespace() string { 101 m.ctrl.T.Helper() 102 ret := m.ctrl.Call(m, "GetNamespace") 103 ret0, _ := ret[0].(string) 104 return ret0 105 } 106 107 // GetNamespace indicates an expected call of GetNamespace. 108 func (mr *MockhasNamespaceMockRecorder) GetNamespace() *gomock.Call { 109 mr.mock.ctrl.T.Helper() 110 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNamespace", reflect.TypeOf((*MockhasNamespace)(nil).GetNamespace)) 111 }