github.com/rakutentech/cli@v6.12.5-0.20151006231303-24468b65536e+incompatible/testhelpers/commands/fake_application_stopper.go (about)

     1  // This file was generated by counterfeiter
     2  package commands
     3  
     4  import (
     5  	"sync"
     6  
     7  	"github.com/cloudfoundry/cli/cf/command_registry"
     8  	"github.com/cloudfoundry/cli/cf/commands/application"
     9  	"github.com/cloudfoundry/cli/cf/models"
    10  	"github.com/cloudfoundry/cli/cf/requirements"
    11  	"github.com/cloudfoundry/cli/flags"
    12  )
    13  
    14  type FakeApplicationStopper struct {
    15  	MetaDataStub        func() command_registry.CommandMetadata
    16  	metaDataMutex       sync.RWMutex
    17  	metaDataArgsForCall []struct{}
    18  	metaDataReturns     struct {
    19  		result1 command_registry.CommandMetadata
    20  	}
    21  	SetDependencyStub        func(deps command_registry.Dependency, pluginCall bool) command_registry.Command
    22  	setDependencyMutex       sync.RWMutex
    23  	setDependencyArgsForCall []struct {
    24  		deps       command_registry.Dependency
    25  		pluginCall bool
    26  	}
    27  	setDependencyReturns struct {
    28  		result1 command_registry.Command
    29  	}
    30  	RequirementsStub        func(requirementsFactory requirements.Factory, context flags.FlagContext) (reqs []requirements.Requirement, err error)
    31  	requirementsMutex       sync.RWMutex
    32  	requirementsArgsForCall []struct {
    33  		requirementsFactory requirements.Factory
    34  		context             flags.FlagContext
    35  	}
    36  	requirementsReturns struct {
    37  		result1 []requirements.Requirement
    38  		result2 error
    39  	}
    40  	ExecuteStub        func(context flags.FlagContext)
    41  	executeMutex       sync.RWMutex
    42  	executeArgsForCall []struct {
    43  		context flags.FlagContext
    44  	}
    45  	ApplicationStopStub        func(app models.Application, orgName string, spaceName string) (updatedApp models.Application, err error)
    46  	applicationStopMutex       sync.RWMutex
    47  	applicationStopArgsForCall []struct {
    48  		app       models.Application
    49  		orgName   string
    50  		spaceName string
    51  	}
    52  	applicationStopReturns struct {
    53  		result1 models.Application
    54  		result2 error
    55  	}
    56  }
    57  
    58  func (fake *FakeApplicationStopper) MetaData() command_registry.CommandMetadata {
    59  	fake.metaDataMutex.Lock()
    60  	fake.metaDataArgsForCall = append(fake.metaDataArgsForCall, struct{}{})
    61  	fake.metaDataMutex.Unlock()
    62  	if fake.MetaDataStub != nil {
    63  		return fake.MetaDataStub()
    64  	} else {
    65  		return fake.metaDataReturns.result1
    66  	}
    67  }
    68  
    69  func (fake *FakeApplicationStopper) MetaDataCallCount() int {
    70  	fake.metaDataMutex.RLock()
    71  	defer fake.metaDataMutex.RUnlock()
    72  	return len(fake.metaDataArgsForCall)
    73  }
    74  
    75  func (fake *FakeApplicationStopper) MetaDataReturns(result1 command_registry.CommandMetadata) {
    76  	fake.MetaDataStub = nil
    77  	fake.metaDataReturns = struct {
    78  		result1 command_registry.CommandMetadata
    79  	}{result1}
    80  }
    81  
    82  func (fake *FakeApplicationStopper) SetDependency(deps command_registry.Dependency, pluginCall bool) command_registry.Command {
    83  	fake.setDependencyMutex.Lock()
    84  	fake.setDependencyArgsForCall = append(fake.setDependencyArgsForCall, struct {
    85  		deps       command_registry.Dependency
    86  		pluginCall bool
    87  	}{deps, pluginCall})
    88  	fake.setDependencyMutex.Unlock()
    89  	if fake.SetDependencyStub != nil {
    90  		return fake.SetDependencyStub(deps, pluginCall)
    91  	} else {
    92  		return fake.setDependencyReturns.result1
    93  	}
    94  }
    95  
    96  func (fake *FakeApplicationStopper) SetDependencyCallCount() int {
    97  	fake.setDependencyMutex.RLock()
    98  	defer fake.setDependencyMutex.RUnlock()
    99  	return len(fake.setDependencyArgsForCall)
   100  }
   101  
   102  func (fake *FakeApplicationStopper) SetDependencyArgsForCall(i int) (command_registry.Dependency, bool) {
   103  	fake.setDependencyMutex.RLock()
   104  	defer fake.setDependencyMutex.RUnlock()
   105  	return fake.setDependencyArgsForCall[i].deps, fake.setDependencyArgsForCall[i].pluginCall
   106  }
   107  
   108  func (fake *FakeApplicationStopper) SetDependencyReturns(result1 command_registry.Command) {
   109  	fake.SetDependencyStub = nil
   110  	fake.setDependencyReturns = struct {
   111  		result1 command_registry.Command
   112  	}{result1}
   113  }
   114  
   115  func (fake *FakeApplicationStopper) Requirements(requirementsFactory requirements.Factory, context flags.FlagContext) (reqs []requirements.Requirement, err error) {
   116  	fake.requirementsMutex.Lock()
   117  	fake.requirementsArgsForCall = append(fake.requirementsArgsForCall, struct {
   118  		requirementsFactory requirements.Factory
   119  		context             flags.FlagContext
   120  	}{requirementsFactory, context})
   121  	fake.requirementsMutex.Unlock()
   122  	if fake.RequirementsStub != nil {
   123  		return fake.RequirementsStub(requirementsFactory, context)
   124  	} else {
   125  		return fake.requirementsReturns.result1, fake.requirementsReturns.result2
   126  	}
   127  }
   128  
   129  func (fake *FakeApplicationStopper) RequirementsCallCount() int {
   130  	fake.requirementsMutex.RLock()
   131  	defer fake.requirementsMutex.RUnlock()
   132  	return len(fake.requirementsArgsForCall)
   133  }
   134  
   135  func (fake *FakeApplicationStopper) RequirementsArgsForCall(i int) (requirements.Factory, flags.FlagContext) {
   136  	fake.requirementsMutex.RLock()
   137  	defer fake.requirementsMutex.RUnlock()
   138  	return fake.requirementsArgsForCall[i].requirementsFactory, fake.requirementsArgsForCall[i].context
   139  }
   140  
   141  func (fake *FakeApplicationStopper) RequirementsReturns(result1 []requirements.Requirement, result2 error) {
   142  	fake.RequirementsStub = nil
   143  	fake.requirementsReturns = struct {
   144  		result1 []requirements.Requirement
   145  		result2 error
   146  	}{result1, result2}
   147  }
   148  
   149  func (fake *FakeApplicationStopper) Execute(context flags.FlagContext) {
   150  	fake.executeMutex.Lock()
   151  	fake.executeArgsForCall = append(fake.executeArgsForCall, struct {
   152  		context flags.FlagContext
   153  	}{context})
   154  	fake.executeMutex.Unlock()
   155  	if fake.ExecuteStub != nil {
   156  		fake.ExecuteStub(context)
   157  	}
   158  }
   159  
   160  func (fake *FakeApplicationStopper) ExecuteCallCount() int {
   161  	fake.executeMutex.RLock()
   162  	defer fake.executeMutex.RUnlock()
   163  	return len(fake.executeArgsForCall)
   164  }
   165  
   166  func (fake *FakeApplicationStopper) ExecuteArgsForCall(i int) flags.FlagContext {
   167  	fake.executeMutex.RLock()
   168  	defer fake.executeMutex.RUnlock()
   169  	return fake.executeArgsForCall[i].context
   170  }
   171  
   172  func (fake *FakeApplicationStopper) ApplicationStop(app models.Application, orgName string, spaceName string) (updatedApp models.Application, err error) {
   173  	fake.applicationStopMutex.Lock()
   174  	fake.applicationStopArgsForCall = append(fake.applicationStopArgsForCall, struct {
   175  		app       models.Application
   176  		orgName   string
   177  		spaceName string
   178  	}{app, orgName, spaceName})
   179  	fake.applicationStopMutex.Unlock()
   180  	if fake.ApplicationStopStub != nil {
   181  		return fake.ApplicationStopStub(app, orgName, spaceName)
   182  	} else {
   183  		return fake.applicationStopReturns.result1, fake.applicationStopReturns.result2
   184  	}
   185  }
   186  
   187  func (fake *FakeApplicationStopper) ApplicationStopCallCount() int {
   188  	fake.applicationStopMutex.RLock()
   189  	defer fake.applicationStopMutex.RUnlock()
   190  	return len(fake.applicationStopArgsForCall)
   191  }
   192  
   193  func (fake *FakeApplicationStopper) ApplicationStopArgsForCall(i int) (models.Application, string, string) {
   194  	fake.applicationStopMutex.RLock()
   195  	defer fake.applicationStopMutex.RUnlock()
   196  	return fake.applicationStopArgsForCall[i].app, fake.applicationStopArgsForCall[i].orgName, fake.applicationStopArgsForCall[i].spaceName
   197  }
   198  
   199  func (fake *FakeApplicationStopper) ApplicationStopReturns(result1 models.Application, result2 error) {
   200  	fake.ApplicationStopStub = nil
   201  	fake.applicationStopReturns = struct {
   202  		result1 models.Application
   203  		result2 error
   204  	}{result1, result2}
   205  }
   206  
   207  var _ application.ApplicationStopper = new(FakeApplicationStopper)