github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/commands/service/servicefakes/fake_app_binder.go (about)

     1  package servicefakes
     2  
     3  import (
     4  	"code.cloudfoundry.org/cli/cf/commandregistry"
     5  	"code.cloudfoundry.org/cli/cf/flags"
     6  	"code.cloudfoundry.org/cli/cf/models"
     7  	"code.cloudfoundry.org/cli/cf/requirements"
     8  )
     9  
    10  type OldFakeAppBinder struct {
    11  	AppsToBind        []models.Application
    12  	InstancesToBindTo []models.ServiceInstance
    13  	Params            map[string]interface{}
    14  
    15  	BindApplicationReturns struct {
    16  		Error error
    17  	}
    18  }
    19  
    20  func (binder *OldFakeAppBinder) BindApplication(app models.Application, service models.ServiceInstance, paramsMap map[string]interface{}) error {
    21  	binder.AppsToBind = append(binder.AppsToBind, app)
    22  	binder.InstancesToBindTo = append(binder.InstancesToBindTo, service)
    23  	binder.Params = paramsMap
    24  
    25  	return binder.BindApplicationReturns.Error
    26  }
    27  
    28  func (binder *OldFakeAppBinder) MetaData() commandregistry.CommandMetadata {
    29  	return commandregistry.CommandMetadata{Name: "bind-service"}
    30  }
    31  
    32  func (binder *OldFakeAppBinder) SetDependency(_ commandregistry.Dependency, _ bool) commandregistry.Command {
    33  	return binder
    34  }
    35  
    36  func (binder *OldFakeAppBinder) Requirements(_ requirements.Factory, _ flags.FlagContext) ([]requirements.Requirement, error) {
    37  	return []requirements.Requirement{}, nil
    38  }
    39  
    40  func (binder *OldFakeAppBinder) Execute(_ flags.FlagContext) error {
    41  	return nil
    42  }