mocks

package
v3.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	InitiallyCall struct {
		Returns struct {
			Error error
		}
	}
	ExecuteCall struct {
		Returns struct {
			Error error
		}
	}
	VerifyCall struct {
		Returns struct {
			Error error
		}
	}
	SuccessCall struct {
		Returns struct {
			Error error
		}
	}
	UndoCall struct {
		Returns struct {
			Error error
		}
	}
	FinallyCall struct {
		Returns struct {
			Error error
		}
	}
}

Action handmade mock for tests.

func (*Action) Execute

func (a *Action) Execute() error

func (*Action) Finally

func (a *Action) Finally() error

func (*Action) Initially

func (a *Action) Initially() error

Action mock method.

func (*Action) Success

func (a *Action) Success() error

func (*Action) Undo

func (a *Action) Undo() error

func (*Action) Verify

func (a *Action) Verify() error

type BlueGreener

type BlueGreener struct {
	ExecuteCall struct {
		Write    string
		Received struct {
			ActionCreator I.ActionCreator
			Environment   S.Environment
			Out           io.Writer
		}
		Returns struct {
			Error I.DeploymentError
		}
	}
}

BlueGreener handmade mock for tests.

func (*BlueGreener) Execute

func (b *BlueGreener) Execute(actionCreator I.ActionCreator, environment S.Environment, out io.ReadWriter) error

Push mock method.

type Client added in v0.7.0

type Client struct {
	GetCall struct {
		Received struct {
			URL string
		}
		Returns struct {
			Response http.Response
			Error    error
		}
	}
}

Client handmade mock for tests.

func (*Client) Get added in v0.7.0

func (c *Client) Get(url string) (*http.Response, error)

Get mock method.

type Controller

type Controller struct {
	RunDeploymentCall struct {
		Called   bool
		Received struct {
			Deployment *I.Deployment
			Response   *bytes.Buffer
			UUID       string
		}
		Write struct {
			Output string
		}
		Returns I.DeployResponse
	}
	RunDeploymentViaHttpCall struct {
		Called   bool
		Received struct {
			Context *gin.Context
		}
	}
	PutRequestHandlerCall struct {
		Called   bool
		Received struct {
			Context *gin.Context
		}
	}
}

func (*Controller) PutRequestHandler

func (c *Controller) PutRequestHandler(g *gin.Context)

func (*Controller) RunDeployment

func (c *Controller) RunDeployment(deployment *I.Deployment, response *bytes.Buffer) I.DeployResponse

func (*Controller) RunDeploymentViaHttp

func (c *Controller) RunDeploymentViaHttp(g *gin.Context)

type Courier

type Courier struct {
	TimesCourierCalled int
	LoginCall          struct {
		Received struct {
			FoundationURL string
			Username      string
			Password      string
			Org           string
			Space         string
			SkipSSL       bool
		}
		Returns struct {
			Output []byte
			Error  error
		}
	}

	StartCall struct {
		Received struct {
			AppName string
		}
		Returns struct {
			Output []byte
			Error  error
		}
	}

	StopCall struct {
		Received struct {
			AppName string
		}
		Returns struct {
			Output []byte
			Error  error
		}
	}

	DeleteCall struct {
		Received struct {
			AppName string
		}
		Returns struct {
			Output []byte
			Error  error
		}
	}

	PushCall struct {
		Received struct {
			AppName   string
			AppPath   string
			Hostname  string
			Instances uint16
		}
		Returns struct {
			Output []byte
			Error  error
		}
	}

	RenameCall struct {
		Received struct {
			AppName          string
			AppNameVenerable string
		}
		Returns struct {
			Output []byte
			Error  error
		}
	}

	LogsCall struct {
		Received struct {
			AppName string
		}
		Returns struct {
			Output []byte
			Error  error
		}
	}

	MapRouteWithPathCall struct {
		TimesCalled int
		Received    struct {
			AppName  []string
			Domain   []string
			Hostname []string
			Path     []string
		}
		Returns struct {
			Output [][]byte
			Error  []error
		}
	}

	MapRouteCall struct {
		TimesCalled int
		Received    struct {
			AppName  []string
			Domain   []string
			Hostname []string
		}
		Returns struct {
			Output [][]byte
			Error  []error
		}
	}

	UnmapRouteCall struct {
		OrderCalled int
		Received    struct {
			AppName  string
			Domain   string
			Hostname string
		}
		Returns struct {
			Output []byte
			Error  error
		}
	}

	DeleteRouteCall struct {
		OrderCalled int
		Received    struct {
			Domain   string
			Hostname string
		}
		Returns struct {
			Output []byte
			Error  error
		}
	}

	CreateServiceCall struct {
	}

	ExistsCall struct {
		Received struct {
			AppName string
		}
		Returns struct {
			Bool bool
		}
	}

	CupsCall struct {
		Received struct {
			AppName string
			Body    string
		}
		Returns struct {
			Output []byte
			Error  error
		}
	}

	UupsCall struct {
		Received struct {
			AppName string
			Body    string
		}
		Returns struct {
			Output []byte
			Error  error
		}
	}

	DomainsCall struct {
		TimesCalled int
		Returns     struct {
			Domains []string
			Error   error
		}
	}

	CleanUpCall struct {
		Returns struct {
			Error error
		}
	}
}

Courier handmade mock for tests.

func (*Courier) BindService

func (c *Courier) BindService(appName, serviceName string) ([]byte, error)

func (*Courier) CleanUp

func (c *Courier) CleanUp() error

CleanUp mock method.

func (*Courier) CreateService

func (c *Courier) CreateService(service, plan, name string) ([]byte, error)

func (*Courier) Cups added in v0.5.0

func (c *Courier) Cups(appName string, body string) ([]byte, error)

Cups mock method

func (*Courier) Delete

func (c *Courier) Delete(appName string) ([]byte, error)

Delete mock method.

func (*Courier) DeleteRoute

func (c *Courier) DeleteRoute(domain, hostname string) ([]byte, error)

DeleteRoute mock method.

func (*Courier) DeleteService

func (c *Courier) DeleteService(serviceName string) ([]byte, error)

func (*Courier) Domains added in v0.8.0

func (c *Courier) Domains() ([]string, error)

Domains mock method.

func (*Courier) Exists

func (c *Courier) Exists(appName string) bool

Exists mock method.

func (*Courier) Login

func (c *Courier) Login(foundationURL, username, password, org, space string, skipSSL bool) ([]byte, error)

Login mock method.

func (*Courier) Logs

func (c *Courier) Logs(appName string) ([]byte, error)

Logs mock method.

func (*Courier) MapRoute

func (c *Courier) MapRoute(appName, domain, hostname string) ([]byte, error)

MapRoute mock method.

func (*Courier) MapRouteWithPath

func (c *Courier) MapRouteWithPath(appName, domain, hostname, path string) ([]byte, error)

MapRoute mock method.

func (*Courier) Push

func (c *Courier) Push(appName, appLocation, hostname string, instances uint16) ([]byte, error)

Push mock method.

func (*Courier) Rename

func (c *Courier) Rename(appName, newAppName string) ([]byte, error)

Rename mock method.

func (*Courier) Restage

func (c *Courier) Restage(appName string) ([]byte, error)

func (*Courier) Start

func (c *Courier) Start(appName string) ([]byte, error)

func (*Courier) Stop

func (c *Courier) Stop(appName string) ([]byte, error)

func (*Courier) UnbindService

func (c *Courier) UnbindService(appName, serviceName string) ([]byte, error)

func (*Courier) UnmapRoute added in v0.7.0

func (c *Courier) UnmapRoute(appName, domain, hostname string) ([]byte, error)

UnmapRoute mock method.

func (*Courier) UnmapRouteWithPath

func (c *Courier) UnmapRouteWithPath(appName, domain, hostname, path string) ([]byte, error)

func (*Courier) Uups added in v0.5.0

func (c *Courier) Uups(appName string, body string) ([]byte, error)

Uups mock method

type Deployer

type Deployer struct {
	DeployCall struct {
		Called   int
		Received struct {
			DeploymentInfo *structs.DeploymentInfo
			Env            structs.Environment
			ActionCreator  I.ActionCreator
			Response       io.ReadWriter
		}
		Write struct {
			Output string
		}
		Returns struct {
			Error      error
			StatusCode int
		}
	}
}

Deployer handmade mock for tests.

func (*Deployer) Deploy

func (d *Deployer) Deploy(deploymentInfo *structs.DeploymentInfo, env structs.Environment, actionCreator I.ActionCreator, out io.ReadWriter) *I.DeployResponse

Deploy mock method.

type Env

type Env struct {
	GetCall struct {
		Received struct {
			Keys []string
		}
		Returns struct {
			Values map[string]string
		}
	}
}

Env handmade mock for tests.

func (*Env) Get

func (e *Env) Get(key string) string

Get mock method.

type ErrorFinder

type ErrorFinder struct {
	FindErrorsCall struct {
		Received struct {
			Response string
		}
		Returns struct {
			Errors []interfaces.LogMatchedError
		}
	}
}

func (*ErrorFinder) FindErrors

func (e *ErrorFinder) FindErrors(responseString string) []interfaces.LogMatchedError

type ErrorMatcherMock

type ErrorMatcherMock struct {
	MatchCall struct {
		Returns interfaces.LogMatchedError
	}
	DescriptorCall struct {
		Returns string
	}
}

func (*ErrorMatcherMock) Descriptor

func (m *ErrorMatcherMock) Descriptor() string

func (*ErrorMatcherMock) Match

func (m *ErrorMatcherMock) Match(matchTo []byte) interfaces.LogMatchedError

type EventBinding

type EventBinding struct {
	AcceptsCall struct {
		Received struct {
			Event interface{}
		}
		Returns struct {
			Bool bool
		}
	}
	EmitCall struct {
		Received struct {
			Event interface{}
		}
		Called struct {
			Bool bool
		}
		Returns struct {
			Error error
		}
	}
}

func (*EventBinding) Accepts

func (b *EventBinding) Accepts(event interface{}) bool

func (*EventBinding) Emit

func (b *EventBinding) Emit(gevent interface{}) error

type EventManager

type EventManager struct {
	AddHandlerCall struct {
		Received struct {
			Handler   I.Handler
			EventType string
		}
		Returns struct {
			Error error
		}
	}
	EmitCall struct {
		TimesCalled int
		Received    struct {
			Events []I.Event
		}
		Returns struct {
			Error []error
		}
	}
	EmitEventCall struct {
		TimesCalled int
		Received    struct {
			Events []I.IEvent
		}
		Returns struct {
			Error []error
		}
	}
}

EventManager handmade mock for tests.

func (*EventManager) AddBinding

func (e *EventManager) AddBinding(binding I.Binding)

func (*EventManager) AddHandler

func (e *EventManager) AddHandler(handler I.Handler, eventType string) error

AddHandler mock method.

func (*EventManager) Emit

func (e *EventManager) Emit(event I.Event) error

Emit mock method.

func (*EventManager) EmitEvent

func (e *EventManager) EmitEvent(event I.IEvent) error

type Executor

type Executor struct {
	ExecuteCall struct {
		Received struct {
			Args []string
		}
		Returns struct {
			Output []byte
			Error  error
		}
	}

	ExecuteInDirectoryCall struct {
		Received struct {
			AppLocation string
			Args        []string
		}
		Returns struct {
			Output []byte
			Error  error
		}
	}

	CleanUpCall struct {
		Returns struct {
			Error error
		}
	}
}

Executor handmade mock for tests.

func (*Executor) CleanUp

func (e *Executor) CleanUp() error

CleanUp mock method.

func (*Executor) Execute

func (e *Executor) Execute(args ...string) ([]byte, error)

Execute mock method.

func (*Executor) ExecuteInDirectory

func (e *Executor) ExecuteInDirectory(appLocation string, args ...string) ([]byte, error)

ExecuteInDirectory mock method.

type Extractor

type Extractor struct {
	UnzipCall struct {
		Received struct {
			Source      string
			Destination string
			Manifest    string
		}
		Returns struct {
			Error error
		}
	}
}

Extractor handmade mock for tests.

func (*Extractor) Unzip

func (e *Extractor) Unzip(source, destination, manifest string) error

Unzip mock method.

type Fetcher

type Fetcher struct {
	FetchCall struct {
		Received struct {
			ArtifactURL string
			Manifest    string
		}
		Returns struct {
			AppPath string
			Error   error
		}
	}

	FetchFromZipCall struct {
		Received struct {
			Request io.Reader
		}
		Returns struct {
			AppPath  string
			Manifest string
			Error    error
		}
	}
}

Fetcher handmade mock for tests.

func (*Fetcher) Fetch

func (f *Fetcher) Fetch(url, manifest string) (string, error)

Fetch mock method.

func (*Fetcher) FetchZipFromRequest added in v0.4.0

func (f *Fetcher) FetchZipFromRequest(body io.Reader) (string, string, error)

FetchZipFromRequest mock method.

type FileSystemCleaner

type FileSystemCleaner struct {
	RemoveAllCall struct {
		Called   bool
		Received struct {
			Path string
		}
		Returns struct {
			Error error
		}
	}
}

func (*FileSystemCleaner) RemoveAll

func (p *FileSystemCleaner) RemoveAll(path string) error

type Handler

type Handler struct {
	OnEventCall struct {
		Received struct {
			Event I.Event
		}
		Returns struct {
			Error error
		}
	}
}

Handler handmade mock for tests.

func (*Handler) OnEvent

func (h *Handler) OnEvent(event I.Event) error

OnEvent mock method.

type HealthChecker added in v0.7.0

type HealthChecker struct {
	CheckCall struct {
		Received struct {
			Endpoint string
			URL      string
		}
		Returns struct {
			Error error
		}
	}
}

HealthChecker handmade mock for tests.

func (*HealthChecker) Check added in v0.7.0

func (h *HealthChecker) Check(endpoint, serverURL string) error

type Prechecker

type Prechecker struct {
	AssertAllFoundationsUpCall struct {
		Received struct {
			Environment S.Environment
		}
		Returns struct {
			Error error
		}
	}
}

Prechecker handmade mock for tests.

func (*Prechecker) AssertAllFoundationsUp

func (p *Prechecker) AssertAllFoundationsUp(environment S.Environment) error

AssertAllFoundationsUp mock method.

type PushController

type PushController struct {
	RunDeploymentCall struct {
		Received struct {
			Deployment *interfaces.Deployment
			Response   *bytes.Buffer
		}
		Returns struct {
			DeployResponse interfaces.DeployResponse
		}
		Writes string
		Called bool
	}
}

func (*PushController) RunDeployment

func (c *PushController) RunDeployment(deployment *interfaces.Deployment, response *bytes.Buffer) (deployResponse interfaces.DeployResponse)

type PushManager

type PushManager struct {
	SetUpCall struct {
		Called  bool
		Returns struct {
			Err error
		}
	}
	OnStartCall struct {
		Called  bool
		Returns struct {
			Err error
		}
	}
	CreatePusherCall struct {
		TimesCalled int
		Returns     struct {
			Pushers []interfaces.Action
			Error   []error
		}
	}
	OnFinishCall struct {
		Called   bool
		Received struct {
			Environment S.Environment
			Response    io.ReadWriter
			Error       error
		}
		Returns struct {
			DeployResponse interfaces.DeployResponse
		}
	}
	CleanUpCall struct {
		Called bool
	}
}

PushManager handmade mock for tests.

func (*PushManager) CleanUp

func (p *PushManager) CleanUp()

func (*PushManager) Create

func (p *PushManager) Create(environment S.Environment, response io.ReadWriter, foundationURL string) (interfaces.Action, error)

func (*PushManager) ExecuteError

func (p *PushManager) ExecuteError(executeErrors []error) error

func (*PushManager) InitiallyError

func (p *PushManager) InitiallyError(initiallyErrors []error) error

func (*PushManager) OnFinish

func (p *PushManager) OnFinish(env S.Environment, response io.ReadWriter, err error) interfaces.DeployResponse

func (*PushManager) OnStart

func (p *PushManager) OnStart() error

func (*PushManager) SetUp

func (p *PushManager) SetUp() error

func (*PushManager) SuccessError

func (p *PushManager) SuccessError(successErrors []error) error

func (*PushManager) UndoError

func (p *PushManager) UndoError(executeErrors, undoErrors []error) error

type PushManagerFactory

type PushManagerFactory struct {
	PushManagerCall struct {
		Called   bool
		Received struct {
			DeployEventData structs.DeployEventData
			CFContext       interfaces.CFContext
			Auth            interfaces.Authorization
			Environment     structs.Environment
			EnvVars         map[string]string
		}
		Returns struct {
			ActionCreator interfaces.ActionCreator
		}
	}
}

PushManager handmade mock for tests.

func (*PushManagerFactory) PushManager

type Pusher

type Pusher struct {
	Response io.ReadWriter

	InitiallyCall struct {
		Write struct {
			Output string
		}
		Returns struct {
			Error error
		}
	}

	ExecuteCall struct {
		Write struct {
			Output string
		}
		Returns struct {
			Error error
		}
	}
	VerifyCall struct {
		Returns struct {
			Error error
		}
	}

	UndoCall struct {
		Returns struct {
			Error error
		}
	}

	SuccessCall struct {
		Returns struct {
			Error error
		}
	}

	FinallyCall struct {
		Returns struct {
			Error error
		}
	}
}

Pusher handmade mock for tests.

func (*Pusher) Execute

func (p *Pusher) Execute() error

Push mock method.

func (*Pusher) Finally

func (p *Pusher) Finally() error

CleanUp mock method.

func (*Pusher) Initially

func (p *Pusher) Initially() error

Login mock method.

func (*Pusher) Success

func (p *Pusher) Success() error

FinishPush mock method.

func (*Pusher) Undo

func (p *Pusher) Undo() error

UndoPush mock method.

func (*Pusher) Verify

func (p *Pusher) Verify() error

type Randomizer

type Randomizer struct {
	RandomizeCall struct {
		Received struct {
			Length int
		}
		Returns struct {
			Runes string
		}
	}
}

Randomizer handmade mock for tests.

func (*Randomizer) StringRunes

func (r *Randomizer) StringRunes(length int) string

StringRunes mock method.

type StartController

type StartController struct {
	StartDeploymentCall struct {
		Received struct {
			Deployment *interfaces.Deployment
			Data       map[string]interface{}
			Response   *bytes.Buffer
		}
		Returns struct {
			DeployResponse interfaces.DeployResponse
		}
		Writes string
		Called bool
	}
}

func (*StartController) StartDeployment

func (c *StartController) StartDeployment(deployment *interfaces.Deployment, data map[string]interface{}, response *bytes.Buffer) (deployResponse interfaces.DeployResponse)

type StartManager

type StartManager struct {
	CreateStarterCall struct {
		TimesCalled int
		Received    []receivedCall
		Returns     struct {
			Starters []interfaces.Action
			Error    []error
		}
	}
}

func (*StartManager) CleanUp

func (s *StartManager) CleanUp()

func (*StartManager) Create

func (s *StartManager) Create(environment S.Environment, response io.ReadWriter, foundationURL string) (interfaces.Action, error)

func (*StartManager) ExecuteError

func (s *StartManager) ExecuteError(executeErrors []error) error

func (*StartManager) InitiallyError

func (s *StartManager) InitiallyError(initiallyErrors []error) error

func (*StartManager) OnFinish

func (s *StartManager) OnFinish(env S.Environment, response io.ReadWriter, err error) interfaces.DeployResponse

func (*StartManager) OnStart

func (s *StartManager) OnStart() error

func (*StartManager) SetUp

func (s *StartManager) SetUp() error

func (*StartManager) SuccessError

func (s *StartManager) SuccessError(successErrors []error) error

func (*StartManager) UndoError

func (s *StartManager) UndoError(executeErrors, undoErrors []error) error

type StartManagerFactory

type StartManagerFactory struct {
	StartManagerCall struct {
		Called   bool
		Received struct {
			DeployEventData structs.DeployEventData
		}
		Returns struct {
			ActionCreater interfaces.ActionCreator
		}
	}
}

func (*StartManagerFactory) StartManager

func (t *StartManagerFactory) StartManager(DeployEventData structs.DeployEventData) interfaces.ActionCreator

type StartStopper

type StartStopper struct {
	InitiallyCall struct {
		Returns struct {
			Error error
		}
	}
	ExecuteCall struct {
		Returns struct {
			Error error
		}
	}
	UndoCall struct {
		Write   string
		Returns struct {
			Error error
		}
	}
	VerifyCall struct {
		Write   string
		Returns struct {
			Error error
		}
	}
	SuccessCall struct {
		Write   string
		Returns struct {
			Error error
		}
	}
	FinallyCall struct {
		Write   string
		Returns struct {
			Error error
		}
	}
}

func (*StartStopper) Execute

func (s *StartStopper) Execute() error

func (*StartStopper) Finally

func (s *StartStopper) Finally() error

func (*StartStopper) Initially

func (s *StartStopper) Initially() error

func (*StartStopper) Success

func (s *StartStopper) Success() error

func (*StartStopper) Undo

func (s *StartStopper) Undo() error

func (*StartStopper) Verify

func (s *StartStopper) Verify() error

type StopController

type StopController struct {
	StopDeploymentCall struct {
		Received struct {
			Deployment *interfaces.Deployment
			Data       map[string]interface{}
			Response   *bytes.Buffer
		}
		Returns struct {
			DeployResponse interfaces.DeployResponse
		}
		Writes string
		Called bool
	}
}

func (*StopController) StopDeployment

func (c *StopController) StopDeployment(deployment *interfaces.Deployment, data map[string]interface{}, response *bytes.Buffer) (deployResponse interfaces.DeployResponse)

type StopManager

type StopManager struct {
	CreateStopperCall struct {
		TimesCalled int
		Received    []receivedCall
		Returns     struct {
			Stoppers []interfaces.Action
			Error    []error
		}
	}
}

func (*StopManager) CleanUp

func (s *StopManager) CleanUp()

func (*StopManager) Create

func (s *StopManager) Create(environment S.Environment, response io.ReadWriter, foundationURL string) (interfaces.Action, error)

func (*StopManager) ExecuteError

func (s *StopManager) ExecuteError(executeErrors []error) error

func (*StopManager) InitiallyError

func (s *StopManager) InitiallyError(initiallyErrors []error) error

func (*StopManager) OnFinish

func (s *StopManager) OnFinish(env S.Environment, response io.ReadWriter, err error) interfaces.DeployResponse

func (*StopManager) OnStart

func (s *StopManager) OnStart() error

func (*StopManager) SetUp

func (s *StopManager) SetUp() error

func (*StopManager) SuccessError

func (s *StopManager) SuccessError(successErrors []error) error

func (*StopManager) UndoError

func (s *StopManager) UndoError(executeErrors, undoErrors []error) error

type StopManagerFactory

type StopManagerFactory struct {
	StopManagerCall struct {
		Called   bool
		Received struct {
			DeployEventData structs.DeployEventData
		}
		Returns struct {
			ActionCreater interfaces.ActionCreator
		}
	}
}

func (*StopManagerFactory) StopManager

func (s *StopManagerFactory) StopManager(DeployEventData structs.DeployEventData) interfaces.ActionCreator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL