github.com/sleungcy-sap/cli@v7.1.0+incompatible/cf/requirements/requirementsfakes/fake_application_requirement.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package requirementsfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/cf/models"
     8  	"code.cloudfoundry.org/cli/cf/requirements"
     9  )
    10  
    11  type FakeApplicationRequirement struct {
    12  	ExecuteStub        func() error
    13  	executeMutex       sync.RWMutex
    14  	executeArgsForCall []struct {
    15  	}
    16  	executeReturns struct {
    17  		result1 error
    18  	}
    19  	executeReturnsOnCall map[int]struct {
    20  		result1 error
    21  	}
    22  	GetApplicationStub        func() models.Application
    23  	getApplicationMutex       sync.RWMutex
    24  	getApplicationArgsForCall []struct {
    25  	}
    26  	getApplicationReturns struct {
    27  		result1 models.Application
    28  	}
    29  	getApplicationReturnsOnCall map[int]struct {
    30  		result1 models.Application
    31  	}
    32  	invocations      map[string][][]interface{}
    33  	invocationsMutex sync.RWMutex
    34  }
    35  
    36  func (fake *FakeApplicationRequirement) Execute() error {
    37  	fake.executeMutex.Lock()
    38  	ret, specificReturn := fake.executeReturnsOnCall[len(fake.executeArgsForCall)]
    39  	fake.executeArgsForCall = append(fake.executeArgsForCall, struct {
    40  	}{})
    41  	fake.recordInvocation("Execute", []interface{}{})
    42  	fake.executeMutex.Unlock()
    43  	if fake.ExecuteStub != nil {
    44  		return fake.ExecuteStub()
    45  	}
    46  	if specificReturn {
    47  		return ret.result1
    48  	}
    49  	fakeReturns := fake.executeReturns
    50  	return fakeReturns.result1
    51  }
    52  
    53  func (fake *FakeApplicationRequirement) ExecuteCallCount() int {
    54  	fake.executeMutex.RLock()
    55  	defer fake.executeMutex.RUnlock()
    56  	return len(fake.executeArgsForCall)
    57  }
    58  
    59  func (fake *FakeApplicationRequirement) ExecuteCalls(stub func() error) {
    60  	fake.executeMutex.Lock()
    61  	defer fake.executeMutex.Unlock()
    62  	fake.ExecuteStub = stub
    63  }
    64  
    65  func (fake *FakeApplicationRequirement) ExecuteReturns(result1 error) {
    66  	fake.executeMutex.Lock()
    67  	defer fake.executeMutex.Unlock()
    68  	fake.ExecuteStub = nil
    69  	fake.executeReturns = struct {
    70  		result1 error
    71  	}{result1}
    72  }
    73  
    74  func (fake *FakeApplicationRequirement) ExecuteReturnsOnCall(i int, result1 error) {
    75  	fake.executeMutex.Lock()
    76  	defer fake.executeMutex.Unlock()
    77  	fake.ExecuteStub = nil
    78  	if fake.executeReturnsOnCall == nil {
    79  		fake.executeReturnsOnCall = make(map[int]struct {
    80  			result1 error
    81  		})
    82  	}
    83  	fake.executeReturnsOnCall[i] = struct {
    84  		result1 error
    85  	}{result1}
    86  }
    87  
    88  func (fake *FakeApplicationRequirement) GetApplication() models.Application {
    89  	fake.getApplicationMutex.Lock()
    90  	ret, specificReturn := fake.getApplicationReturnsOnCall[len(fake.getApplicationArgsForCall)]
    91  	fake.getApplicationArgsForCall = append(fake.getApplicationArgsForCall, struct {
    92  	}{})
    93  	fake.recordInvocation("GetApplication", []interface{}{})
    94  	fake.getApplicationMutex.Unlock()
    95  	if fake.GetApplicationStub != nil {
    96  		return fake.GetApplicationStub()
    97  	}
    98  	if specificReturn {
    99  		return ret.result1
   100  	}
   101  	fakeReturns := fake.getApplicationReturns
   102  	return fakeReturns.result1
   103  }
   104  
   105  func (fake *FakeApplicationRequirement) GetApplicationCallCount() int {
   106  	fake.getApplicationMutex.RLock()
   107  	defer fake.getApplicationMutex.RUnlock()
   108  	return len(fake.getApplicationArgsForCall)
   109  }
   110  
   111  func (fake *FakeApplicationRequirement) GetApplicationCalls(stub func() models.Application) {
   112  	fake.getApplicationMutex.Lock()
   113  	defer fake.getApplicationMutex.Unlock()
   114  	fake.GetApplicationStub = stub
   115  }
   116  
   117  func (fake *FakeApplicationRequirement) GetApplicationReturns(result1 models.Application) {
   118  	fake.getApplicationMutex.Lock()
   119  	defer fake.getApplicationMutex.Unlock()
   120  	fake.GetApplicationStub = nil
   121  	fake.getApplicationReturns = struct {
   122  		result1 models.Application
   123  	}{result1}
   124  }
   125  
   126  func (fake *FakeApplicationRequirement) GetApplicationReturnsOnCall(i int, result1 models.Application) {
   127  	fake.getApplicationMutex.Lock()
   128  	defer fake.getApplicationMutex.Unlock()
   129  	fake.GetApplicationStub = nil
   130  	if fake.getApplicationReturnsOnCall == nil {
   131  		fake.getApplicationReturnsOnCall = make(map[int]struct {
   132  			result1 models.Application
   133  		})
   134  	}
   135  	fake.getApplicationReturnsOnCall[i] = struct {
   136  		result1 models.Application
   137  	}{result1}
   138  }
   139  
   140  func (fake *FakeApplicationRequirement) Invocations() map[string][][]interface{} {
   141  	fake.invocationsMutex.RLock()
   142  	defer fake.invocationsMutex.RUnlock()
   143  	fake.executeMutex.RLock()
   144  	defer fake.executeMutex.RUnlock()
   145  	fake.getApplicationMutex.RLock()
   146  	defer fake.getApplicationMutex.RUnlock()
   147  	copiedInvocations := map[string][][]interface{}{}
   148  	for key, value := range fake.invocations {
   149  		copiedInvocations[key] = value
   150  	}
   151  	return copiedInvocations
   152  }
   153  
   154  func (fake *FakeApplicationRequirement) recordInvocation(key string, args []interface{}) {
   155  	fake.invocationsMutex.Lock()
   156  	defer fake.invocationsMutex.Unlock()
   157  	if fake.invocations == nil {
   158  		fake.invocations = map[string][][]interface{}{}
   159  	}
   160  	if fake.invocations[key] == nil {
   161  		fake.invocations[key] = [][]interface{}{}
   162  	}
   163  	fake.invocations[key] = append(fake.invocations[key], args)
   164  }
   165  
   166  var _ requirements.ApplicationRequirement = new(FakeApplicationRequirement)