github.com/cloudfoundry-attic/cli-with-i18n@v6.32.1-0.20171002233121-7401370d3b85+incompatible/command/v3/v3fakes/fake_v3apps_actor.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package v3fakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/actor/v3action"
     8  	"code.cloudfoundry.org/cli/command/v3"
     9  )
    10  
    11  type FakeV3AppsActor struct {
    12  	CloudControllerAPIVersionStub        func() string
    13  	cloudControllerAPIVersionMutex       sync.RWMutex
    14  	cloudControllerAPIVersionArgsForCall []struct{}
    15  	cloudControllerAPIVersionReturns     struct {
    16  		result1 string
    17  	}
    18  	cloudControllerAPIVersionReturnsOnCall map[int]struct {
    19  		result1 string
    20  	}
    21  	GetApplicationsWithProcessesBySpaceStub        func(spaceGUID string) ([]v3action.ApplicationWithProcessSummary, v3action.Warnings, error)
    22  	getApplicationsWithProcessesBySpaceMutex       sync.RWMutex
    23  	getApplicationsWithProcessesBySpaceArgsForCall []struct {
    24  		spaceGUID string
    25  	}
    26  	getApplicationsWithProcessesBySpaceReturns struct {
    27  		result1 []v3action.ApplicationWithProcessSummary
    28  		result2 v3action.Warnings
    29  		result3 error
    30  	}
    31  	getApplicationsWithProcessesBySpaceReturnsOnCall map[int]struct {
    32  		result1 []v3action.ApplicationWithProcessSummary
    33  		result2 v3action.Warnings
    34  		result3 error
    35  	}
    36  	invocations      map[string][][]interface{}
    37  	invocationsMutex sync.RWMutex
    38  }
    39  
    40  func (fake *FakeV3AppsActor) CloudControllerAPIVersion() string {
    41  	fake.cloudControllerAPIVersionMutex.Lock()
    42  	ret, specificReturn := fake.cloudControllerAPIVersionReturnsOnCall[len(fake.cloudControllerAPIVersionArgsForCall)]
    43  	fake.cloudControllerAPIVersionArgsForCall = append(fake.cloudControllerAPIVersionArgsForCall, struct{}{})
    44  	fake.recordInvocation("CloudControllerAPIVersion", []interface{}{})
    45  	fake.cloudControllerAPIVersionMutex.Unlock()
    46  	if fake.CloudControllerAPIVersionStub != nil {
    47  		return fake.CloudControllerAPIVersionStub()
    48  	}
    49  	if specificReturn {
    50  		return ret.result1
    51  	}
    52  	return fake.cloudControllerAPIVersionReturns.result1
    53  }
    54  
    55  func (fake *FakeV3AppsActor) CloudControllerAPIVersionCallCount() int {
    56  	fake.cloudControllerAPIVersionMutex.RLock()
    57  	defer fake.cloudControllerAPIVersionMutex.RUnlock()
    58  	return len(fake.cloudControllerAPIVersionArgsForCall)
    59  }
    60  
    61  func (fake *FakeV3AppsActor) CloudControllerAPIVersionReturns(result1 string) {
    62  	fake.CloudControllerAPIVersionStub = nil
    63  	fake.cloudControllerAPIVersionReturns = struct {
    64  		result1 string
    65  	}{result1}
    66  }
    67  
    68  func (fake *FakeV3AppsActor) CloudControllerAPIVersionReturnsOnCall(i int, result1 string) {
    69  	fake.CloudControllerAPIVersionStub = nil
    70  	if fake.cloudControllerAPIVersionReturnsOnCall == nil {
    71  		fake.cloudControllerAPIVersionReturnsOnCall = make(map[int]struct {
    72  			result1 string
    73  		})
    74  	}
    75  	fake.cloudControllerAPIVersionReturnsOnCall[i] = struct {
    76  		result1 string
    77  	}{result1}
    78  }
    79  
    80  func (fake *FakeV3AppsActor) GetApplicationsWithProcessesBySpace(spaceGUID string) ([]v3action.ApplicationWithProcessSummary, v3action.Warnings, error) {
    81  	fake.getApplicationsWithProcessesBySpaceMutex.Lock()
    82  	ret, specificReturn := fake.getApplicationsWithProcessesBySpaceReturnsOnCall[len(fake.getApplicationsWithProcessesBySpaceArgsForCall)]
    83  	fake.getApplicationsWithProcessesBySpaceArgsForCall = append(fake.getApplicationsWithProcessesBySpaceArgsForCall, struct {
    84  		spaceGUID string
    85  	}{spaceGUID})
    86  	fake.recordInvocation("GetApplicationsWithProcessesBySpace", []interface{}{spaceGUID})
    87  	fake.getApplicationsWithProcessesBySpaceMutex.Unlock()
    88  	if fake.GetApplicationsWithProcessesBySpaceStub != nil {
    89  		return fake.GetApplicationsWithProcessesBySpaceStub(spaceGUID)
    90  	}
    91  	if specificReturn {
    92  		return ret.result1, ret.result2, ret.result3
    93  	}
    94  	return fake.getApplicationsWithProcessesBySpaceReturns.result1, fake.getApplicationsWithProcessesBySpaceReturns.result2, fake.getApplicationsWithProcessesBySpaceReturns.result3
    95  }
    96  
    97  func (fake *FakeV3AppsActor) GetApplicationsWithProcessesBySpaceCallCount() int {
    98  	fake.getApplicationsWithProcessesBySpaceMutex.RLock()
    99  	defer fake.getApplicationsWithProcessesBySpaceMutex.RUnlock()
   100  	return len(fake.getApplicationsWithProcessesBySpaceArgsForCall)
   101  }
   102  
   103  func (fake *FakeV3AppsActor) GetApplicationsWithProcessesBySpaceArgsForCall(i int) string {
   104  	fake.getApplicationsWithProcessesBySpaceMutex.RLock()
   105  	defer fake.getApplicationsWithProcessesBySpaceMutex.RUnlock()
   106  	return fake.getApplicationsWithProcessesBySpaceArgsForCall[i].spaceGUID
   107  }
   108  
   109  func (fake *FakeV3AppsActor) GetApplicationsWithProcessesBySpaceReturns(result1 []v3action.ApplicationWithProcessSummary, result2 v3action.Warnings, result3 error) {
   110  	fake.GetApplicationsWithProcessesBySpaceStub = nil
   111  	fake.getApplicationsWithProcessesBySpaceReturns = struct {
   112  		result1 []v3action.ApplicationWithProcessSummary
   113  		result2 v3action.Warnings
   114  		result3 error
   115  	}{result1, result2, result3}
   116  }
   117  
   118  func (fake *FakeV3AppsActor) GetApplicationsWithProcessesBySpaceReturnsOnCall(i int, result1 []v3action.ApplicationWithProcessSummary, result2 v3action.Warnings, result3 error) {
   119  	fake.GetApplicationsWithProcessesBySpaceStub = nil
   120  	if fake.getApplicationsWithProcessesBySpaceReturnsOnCall == nil {
   121  		fake.getApplicationsWithProcessesBySpaceReturnsOnCall = make(map[int]struct {
   122  			result1 []v3action.ApplicationWithProcessSummary
   123  			result2 v3action.Warnings
   124  			result3 error
   125  		})
   126  	}
   127  	fake.getApplicationsWithProcessesBySpaceReturnsOnCall[i] = struct {
   128  		result1 []v3action.ApplicationWithProcessSummary
   129  		result2 v3action.Warnings
   130  		result3 error
   131  	}{result1, result2, result3}
   132  }
   133  
   134  func (fake *FakeV3AppsActor) Invocations() map[string][][]interface{} {
   135  	fake.invocationsMutex.RLock()
   136  	defer fake.invocationsMutex.RUnlock()
   137  	fake.cloudControllerAPIVersionMutex.RLock()
   138  	defer fake.cloudControllerAPIVersionMutex.RUnlock()
   139  	fake.getApplicationsWithProcessesBySpaceMutex.RLock()
   140  	defer fake.getApplicationsWithProcessesBySpaceMutex.RUnlock()
   141  	copiedInvocations := map[string][][]interface{}{}
   142  	for key, value := range fake.invocations {
   143  		copiedInvocations[key] = value
   144  	}
   145  	return copiedInvocations
   146  }
   147  
   148  func (fake *FakeV3AppsActor) recordInvocation(key string, args []interface{}) {
   149  	fake.invocationsMutex.Lock()
   150  	defer fake.invocationsMutex.Unlock()
   151  	if fake.invocations == nil {
   152  		fake.invocations = map[string][][]interface{}{}
   153  	}
   154  	if fake.invocations[key] == nil {
   155  		fake.invocations[key] = [][]interface{}{}
   156  	}
   157  	fake.invocations[key] = append(fake.invocations[key], args)
   158  }
   159  
   160  var _ v3.V3AppsActor = new(FakeV3AppsActor)