forked from cloudfoundry-attic/bosh-init
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_deployment_repo.go
35 lines (28 loc) · 928 Bytes
/
fake_deployment_repo.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package fakes
type FakeDeploymentRepo struct {
UpdateCurrentManifestSHA1 string
UpdateCurrentErr error
findCurrentOutput deploymentRepoFindCurrentOutput
}
type deploymentRepoFindCurrentOutput struct {
manifestSHA1 string
found bool
err error
}
func NewFakeDeploymentRepo() *FakeDeploymentRepo {
return &FakeDeploymentRepo{}
}
func (r *FakeDeploymentRepo) UpdateCurrent(manifestSHA1 string) error {
r.UpdateCurrentManifestSHA1 = manifestSHA1
return r.UpdateCurrentErr
}
func (r *FakeDeploymentRepo) FindCurrent() (manifestSHA1 string, found bool, err error) {
return r.findCurrentOutput.manifestSHA1, r.findCurrentOutput.found, r.findCurrentOutput.err
}
func (r *FakeDeploymentRepo) SetFindCurrentBehavior(manifestSHA1 string, found bool, err error) {
r.findCurrentOutput = deploymentRepoFindCurrentOutput{
manifestSHA1: manifestSHA1,
found: found,
err: err,
}
}