forked from vmware-archive/atc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_build_starter_builds_db.go
81 lines (71 loc) · 2.41 KB
/
fake_build_starter_builds_db.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// This file was generated by counterfeiter
package buildstarterfakes
import (
"sync"
"github.com/concourse/atc/db"
"github.com/concourse/atc/scheduler/buildstarter"
)
type FakeBuildStarterBuildsDB struct {
FinishBuildStub func(buildID int, pipelineID int, status db.Status) error
finishBuildMutex sync.RWMutex
finishBuildArgsForCall []struct {
buildID int
pipelineID int
status db.Status
}
finishBuildReturns struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeBuildStarterBuildsDB) FinishBuild(buildID int, pipelineID int, status db.Status) error {
fake.finishBuildMutex.Lock()
fake.finishBuildArgsForCall = append(fake.finishBuildArgsForCall, struct {
buildID int
pipelineID int
status db.Status
}{buildID, pipelineID, status})
fake.recordInvocation("FinishBuild", []interface{}{buildID, pipelineID, status})
fake.finishBuildMutex.Unlock()
if fake.FinishBuildStub != nil {
return fake.FinishBuildStub(buildID, pipelineID, status)
} else {
return fake.finishBuildReturns.result1
}
}
func (fake *FakeBuildStarterBuildsDB) FinishBuildCallCount() int {
fake.finishBuildMutex.RLock()
defer fake.finishBuildMutex.RUnlock()
return len(fake.finishBuildArgsForCall)
}
func (fake *FakeBuildStarterBuildsDB) FinishBuildArgsForCall(i int) (int, int, db.Status) {
fake.finishBuildMutex.RLock()
defer fake.finishBuildMutex.RUnlock()
return fake.finishBuildArgsForCall[i].buildID, fake.finishBuildArgsForCall[i].pipelineID, fake.finishBuildArgsForCall[i].status
}
func (fake *FakeBuildStarterBuildsDB) FinishBuildReturns(result1 error) {
fake.FinishBuildStub = nil
fake.finishBuildReturns = struct {
result1 error
}{result1}
}
func (fake *FakeBuildStarterBuildsDB) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.finishBuildMutex.RLock()
defer fake.finishBuildMutex.RUnlock()
return fake.invocations
}
func (fake *FakeBuildStarterBuildsDB) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ buildstarter.BuildStarterBuildsDB = new(FakeBuildStarterBuildsDB)