github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/command/v6/v6fakes/fake_sshactor.go (about)

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