forked from cloudfoundry/bosh-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_applier.go
43 lines (35 loc) · 1.07 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
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
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(desiredApplySpec boshas.ApplySpec) error {
s.Applied = true
s.ApplyDesiredApplySpec = desiredApplySpec
return s.ApplyError
}