forked from vmware-archive/atc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_artifact_destination.go
79 lines (69 loc) · 2.08 KB
/
fake_artifact_destination.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
// This file was generated by counterfeiter
package resourcefakes
import (
"io"
"sync"
"github.com/concourse/atc/resource"
)
type FakeArtifactDestination struct {
StreamInStub func(string, io.Reader) error
streamInMutex sync.RWMutex
streamInArgsForCall []struct {
arg1 string
arg2 io.Reader
}
streamInReturns struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeArtifactDestination) StreamIn(arg1 string, arg2 io.Reader) error {
fake.streamInMutex.Lock()
fake.streamInArgsForCall = append(fake.streamInArgsForCall, struct {
arg1 string
arg2 io.Reader
}{arg1, arg2})
fake.recordInvocation("StreamIn", []interface{}{arg1, arg2})
fake.streamInMutex.Unlock()
if fake.StreamInStub != nil {
return fake.StreamInStub(arg1, arg2)
} else {
return fake.streamInReturns.result1
}
}
func (fake *FakeArtifactDestination) StreamInCallCount() int {
fake.streamInMutex.RLock()
defer fake.streamInMutex.RUnlock()
return len(fake.streamInArgsForCall)
}
func (fake *FakeArtifactDestination) StreamInArgsForCall(i int) (string, io.Reader) {
fake.streamInMutex.RLock()
defer fake.streamInMutex.RUnlock()
return fake.streamInArgsForCall[i].arg1, fake.streamInArgsForCall[i].arg2
}
func (fake *FakeArtifactDestination) StreamInReturns(result1 error) {
fake.StreamInStub = nil
fake.streamInReturns = struct {
result1 error
}{result1}
}
func (fake *FakeArtifactDestination) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.streamInMutex.RLock()
defer fake.streamInMutex.RUnlock()
return fake.invocations
}
func (fake *FakeArtifactDestination) 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 _ resource.ArtifactDestination = new(FakeArtifactDestination)