forked from cloudfoundry/bosh-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_applier.go
45 lines (37 loc) · 1.17 KB
/
fake_applier.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
36
37
38
39
40
41
42
43
44
45
package fakes
import (
boshas "github.com/cloudfoundry/bosh-agent/agent/applier/applyspec"
"github.com/cloudfoundry/bosh-agent/agent/applier/models"
)
type FakeApplier struct {
Prepared bool
PrepareDesiredApplySpec boshas.ApplySpec
PrepareError error
Applied bool
ApplyCurrentApplySpec boshas.ApplySpec
ApplyDesiredApplySpec boshas.ApplySpec
ApplyError error
Configured bool
ConfiguredDesiredApplySpec boshas.ApplySpec
ConfiguredJobs []models.Job
ConfiguredError error
}
func NewFakeApplier() *FakeApplier {
return &FakeApplier{}
}
func (s *FakeApplier) Prepare(desiredApplySpec boshas.ApplySpec) error {
s.Prepared = true
s.PrepareDesiredApplySpec = desiredApplySpec
return s.PrepareError
}
func (s *FakeApplier) ConfigureJobs(desiredApplySpec boshas.ApplySpec) error {
s.Configured = true
s.ConfiguredDesiredApplySpec = desiredApplySpec
return s.ConfiguredError
}
func (s *FakeApplier) Apply(currentApplySpec, desiredApplySpec boshas.ApplySpec) error {
s.Applied = true
s.ApplyCurrentApplySpec = currentApplySpec
s.ApplyDesiredApplySpec = desiredApplySpec
return s.ApplyError
}