github.com/lukasheimann/cloudfoundrycli@v7.1.0+incompatible/actor/v7action/v7actionfakes/fake_sshactor.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package v7actionfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/actor/sharedaction" 8 "code.cloudfoundry.org/cli/actor/v7action" 9 ) 10 11 type FakeSSHActor struct { 12 ExecuteSecureShellStub func(sharedaction.SSHOptions) error 13 executeSecureShellMutex sync.RWMutex 14 executeSecureShellArgsForCall []struct { 15 arg1 sharedaction.SSHOptions 16 } 17 executeSecureShellReturns struct { 18 result1 error 19 } 20 executeSecureShellReturnsOnCall map[int]struct { 21 result1 error 22 } 23 invocations map[string][][]interface{} 24 invocationsMutex sync.RWMutex 25 } 26 27 func (fake *FakeSSHActor) ExecuteSecureShell(arg1 sharedaction.SSHOptions) error { 28 fake.executeSecureShellMutex.Lock() 29 ret, specificReturn := fake.executeSecureShellReturnsOnCall[len(fake.executeSecureShellArgsForCall)] 30 fake.executeSecureShellArgsForCall = append(fake.executeSecureShellArgsForCall, struct { 31 arg1 sharedaction.SSHOptions 32 }{arg1}) 33 fake.recordInvocation("ExecuteSecureShell", []interface{}{arg1}) 34 fake.executeSecureShellMutex.Unlock() 35 if fake.ExecuteSecureShellStub != nil { 36 return fake.ExecuteSecureShellStub(arg1) 37 } 38 if specificReturn { 39 return ret.result1 40 } 41 fakeReturns := fake.executeSecureShellReturns 42 return fakeReturns.result1 43 } 44 45 func (fake *FakeSSHActor) ExecuteSecureShellCallCount() int { 46 fake.executeSecureShellMutex.RLock() 47 defer fake.executeSecureShellMutex.RUnlock() 48 return len(fake.executeSecureShellArgsForCall) 49 } 50 51 func (fake *FakeSSHActor) ExecuteSecureShellCalls(stub func(sharedaction.SSHOptions) error) { 52 fake.executeSecureShellMutex.Lock() 53 defer fake.executeSecureShellMutex.Unlock() 54 fake.ExecuteSecureShellStub = stub 55 } 56 57 func (fake *FakeSSHActor) ExecuteSecureShellArgsForCall(i int) sharedaction.SSHOptions { 58 fake.executeSecureShellMutex.RLock() 59 defer fake.executeSecureShellMutex.RUnlock() 60 argsForCall := fake.executeSecureShellArgsForCall[i] 61 return argsForCall.arg1 62 } 63 64 func (fake *FakeSSHActor) ExecuteSecureShellReturns(result1 error) { 65 fake.executeSecureShellMutex.Lock() 66 defer fake.executeSecureShellMutex.Unlock() 67 fake.ExecuteSecureShellStub = nil 68 fake.executeSecureShellReturns = struct { 69 result1 error 70 }{result1} 71 } 72 73 func (fake *FakeSSHActor) ExecuteSecureShellReturnsOnCall(i int, result1 error) { 74 fake.executeSecureShellMutex.Lock() 75 defer fake.executeSecureShellMutex.Unlock() 76 fake.ExecuteSecureShellStub = nil 77 if fake.executeSecureShellReturnsOnCall == nil { 78 fake.executeSecureShellReturnsOnCall = make(map[int]struct { 79 result1 error 80 }) 81 } 82 fake.executeSecureShellReturnsOnCall[i] = struct { 83 result1 error 84 }{result1} 85 } 86 87 func (fake *FakeSSHActor) Invocations() map[string][][]interface{} { 88 fake.invocationsMutex.RLock() 89 defer fake.invocationsMutex.RUnlock() 90 fake.executeSecureShellMutex.RLock() 91 defer fake.executeSecureShellMutex.RUnlock() 92 copiedInvocations := map[string][][]interface{}{} 93 for key, value := range fake.invocations { 94 copiedInvocations[key] = value 95 } 96 return copiedInvocations 97 } 98 99 func (fake *FakeSSHActor) recordInvocation(key string, args []interface{}) { 100 fake.invocationsMutex.Lock() 101 defer fake.invocationsMutex.Unlock() 102 if fake.invocations == nil { 103 fake.invocations = map[string][][]interface{}{} 104 } 105 if fake.invocations[key] == nil { 106 fake.invocations[key] = [][]interface{}{} 107 } 108 fake.invocations[key] = append(fake.invocations[key], args) 109 } 110 111 var _ v7action.SSHActor = new(FakeSSHActor)