github.com/franc20/ayesa_sap@v7.0.0-beta.28.0.20200124003224-302d4d52fa6c+incompatible/command/v7/v7fakes/fake_apply_manifest_actor.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package v7fakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/actor/v7action"
     8  	v7 "code.cloudfoundry.org/cli/command/v7"
     9  )
    10  
    11  type FakeApplyManifestActor struct {
    12  	SetSpaceManifestStub        func(string, []byte) (v7action.Warnings, error)
    13  	setSpaceManifestMutex       sync.RWMutex
    14  	setSpaceManifestArgsForCall []struct {
    15  		arg1 string
    16  		arg2 []byte
    17  	}
    18  	setSpaceManifestReturns struct {
    19  		result1 v7action.Warnings
    20  		result2 error
    21  	}
    22  	setSpaceManifestReturnsOnCall map[int]struct {
    23  		result1 v7action.Warnings
    24  		result2 error
    25  	}
    26  	invocations      map[string][][]interface{}
    27  	invocationsMutex sync.RWMutex
    28  }
    29  
    30  func (fake *FakeApplyManifestActor) SetSpaceManifest(arg1 string, arg2 []byte) (v7action.Warnings, error) {
    31  	var arg2Copy []byte
    32  	if arg2 != nil {
    33  		arg2Copy = make([]byte, len(arg2))
    34  		copy(arg2Copy, arg2)
    35  	}
    36  	fake.setSpaceManifestMutex.Lock()
    37  	ret, specificReturn := fake.setSpaceManifestReturnsOnCall[len(fake.setSpaceManifestArgsForCall)]
    38  	fake.setSpaceManifestArgsForCall = append(fake.setSpaceManifestArgsForCall, struct {
    39  		arg1 string
    40  		arg2 []byte
    41  	}{arg1, arg2Copy})
    42  	fake.recordInvocation("SetSpaceManifest", []interface{}{arg1, arg2Copy})
    43  	fake.setSpaceManifestMutex.Unlock()
    44  	if fake.SetSpaceManifestStub != nil {
    45  		return fake.SetSpaceManifestStub(arg1, arg2)
    46  	}
    47  	if specificReturn {
    48  		return ret.result1, ret.result2
    49  	}
    50  	fakeReturns := fake.setSpaceManifestReturns
    51  	return fakeReturns.result1, fakeReturns.result2
    52  }
    53  
    54  func (fake *FakeApplyManifestActor) SetSpaceManifestCallCount() int {
    55  	fake.setSpaceManifestMutex.RLock()
    56  	defer fake.setSpaceManifestMutex.RUnlock()
    57  	return len(fake.setSpaceManifestArgsForCall)
    58  }
    59  
    60  func (fake *FakeApplyManifestActor) SetSpaceManifestCalls(stub func(string, []byte) (v7action.Warnings, error)) {
    61  	fake.setSpaceManifestMutex.Lock()
    62  	defer fake.setSpaceManifestMutex.Unlock()
    63  	fake.SetSpaceManifestStub = stub
    64  }
    65  
    66  func (fake *FakeApplyManifestActor) SetSpaceManifestArgsForCall(i int) (string, []byte) {
    67  	fake.setSpaceManifestMutex.RLock()
    68  	defer fake.setSpaceManifestMutex.RUnlock()
    69  	argsForCall := fake.setSpaceManifestArgsForCall[i]
    70  	return argsForCall.arg1, argsForCall.arg2
    71  }
    72  
    73  func (fake *FakeApplyManifestActor) SetSpaceManifestReturns(result1 v7action.Warnings, result2 error) {
    74  	fake.setSpaceManifestMutex.Lock()
    75  	defer fake.setSpaceManifestMutex.Unlock()
    76  	fake.SetSpaceManifestStub = nil
    77  	fake.setSpaceManifestReturns = struct {
    78  		result1 v7action.Warnings
    79  		result2 error
    80  	}{result1, result2}
    81  }
    82  
    83  func (fake *FakeApplyManifestActor) SetSpaceManifestReturnsOnCall(i int, result1 v7action.Warnings, result2 error) {
    84  	fake.setSpaceManifestMutex.Lock()
    85  	defer fake.setSpaceManifestMutex.Unlock()
    86  	fake.SetSpaceManifestStub = nil
    87  	if fake.setSpaceManifestReturnsOnCall == nil {
    88  		fake.setSpaceManifestReturnsOnCall = make(map[int]struct {
    89  			result1 v7action.Warnings
    90  			result2 error
    91  		})
    92  	}
    93  	fake.setSpaceManifestReturnsOnCall[i] = struct {
    94  		result1 v7action.Warnings
    95  		result2 error
    96  	}{result1, result2}
    97  }
    98  
    99  func (fake *FakeApplyManifestActor) Invocations() map[string][][]interface{} {
   100  	fake.invocationsMutex.RLock()
   101  	defer fake.invocationsMutex.RUnlock()
   102  	fake.setSpaceManifestMutex.RLock()
   103  	defer fake.setSpaceManifestMutex.RUnlock()
   104  	copiedInvocations := map[string][][]interface{}{}
   105  	for key, value := range fake.invocations {
   106  		copiedInvocations[key] = value
   107  	}
   108  	return copiedInvocations
   109  }
   110  
   111  func (fake *FakeApplyManifestActor) recordInvocation(key string, args []interface{}) {
   112  	fake.invocationsMutex.Lock()
   113  	defer fake.invocationsMutex.Unlock()
   114  	if fake.invocations == nil {
   115  		fake.invocations = map[string][][]interface{}{}
   116  	}
   117  	if fake.invocations[key] == nil {
   118  		fake.invocations[key] = [][]interface{}{}
   119  	}
   120  	fake.invocations[key] = append(fake.invocations[key], args)
   121  }
   122  
   123  var _ v7.ApplyManifestActor = new(FakeApplyManifestActor)