1// Code generated by mockery v1.0.0. DO NOT EDIT.
2
3package cache
4
5import (
6	types "github.com/aquasecurity/fanal/types"
7	mock "github.com/stretchr/testify/mock"
8)
9
10// MockArtifactCache is an autogenerated mock type for the ArtifactCache type
11type MockArtifactCache struct {
12	mock.Mock
13}
14
15type ArtifactCacheMissingBlobsArgs struct {
16	ArtifactID         string
17	ArtifactIDAnything bool
18	BlobIDs            []string
19	BlobIDsAnything    bool
20}
21
22type ArtifactCacheMissingBlobsReturns struct {
23	MissingArtifact bool
24	MissingBlobIDs  []string
25	Err             error
26}
27
28type ArtifactCacheMissingBlobsExpectation struct {
29	Args    ArtifactCacheMissingBlobsArgs
30	Returns ArtifactCacheMissingBlobsReturns
31}
32
33func (_m *MockArtifactCache) ApplyMissingBlobsExpectation(e ArtifactCacheMissingBlobsExpectation) {
34	var args []interface{}
35	if e.Args.ArtifactIDAnything {
36		args = append(args, mock.Anything)
37	} else {
38		args = append(args, e.Args.ArtifactID)
39	}
40	if e.Args.BlobIDsAnything {
41		args = append(args, mock.Anything)
42	} else {
43		args = append(args, e.Args.BlobIDs)
44	}
45	_m.On("MissingBlobs", args...).Return(e.Returns.MissingArtifact, e.Returns.MissingBlobIDs, e.Returns.Err)
46}
47
48func (_m *MockArtifactCache) ApplyMissingBlobsExpectations(expectations []ArtifactCacheMissingBlobsExpectation) {
49	for _, e := range expectations {
50		_m.ApplyMissingBlobsExpectation(e)
51	}
52}
53
54// MissingBlobs provides a mock function with given fields: artifactID, blobIDs
55func (_m *MockArtifactCache) MissingBlobs(artifactID string, blobIDs []string) (bool, []string, error) {
56	ret := _m.Called(artifactID, blobIDs)
57
58	var r0 bool
59	if rf, ok := ret.Get(0).(func(string, []string) bool); ok {
60		r0 = rf(artifactID, blobIDs)
61	} else {
62		r0 = ret.Get(0).(bool)
63	}
64
65	var r1 []string
66	if rf, ok := ret.Get(1).(func(string, []string) []string); ok {
67		r1 = rf(artifactID, blobIDs)
68	} else {
69		if ret.Get(1) != nil {
70			r1 = ret.Get(1).([]string)
71		}
72	}
73
74	var r2 error
75	if rf, ok := ret.Get(2).(func(string, []string) error); ok {
76		r2 = rf(artifactID, blobIDs)
77	} else {
78		r2 = ret.Error(2)
79	}
80
81	return r0, r1, r2
82}
83
84type ArtifactCachePutArtifactArgs struct {
85	ArtifactID           string
86	ArtifactIDAnything   bool
87	ArtifactInfo         types.ArtifactInfo
88	ArtifactInfoAnything bool
89}
90
91type ArtifactCachePutArtifactReturns struct {
92	Err error
93}
94
95type ArtifactCachePutArtifactExpectation struct {
96	Args    ArtifactCachePutArtifactArgs
97	Returns ArtifactCachePutArtifactReturns
98}
99
100func (_m *MockArtifactCache) ApplyPutArtifactExpectation(e ArtifactCachePutArtifactExpectation) {
101	var args []interface{}
102	if e.Args.ArtifactIDAnything {
103		args = append(args, mock.Anything)
104	} else {
105		args = append(args, e.Args.ArtifactID)
106	}
107	if e.Args.ArtifactInfoAnything {
108		args = append(args, mock.Anything)
109	} else {
110		args = append(args, e.Args.ArtifactInfo)
111	}
112	_m.On("PutArtifact", args...).Return(e.Returns.Err)
113}
114
115func (_m *MockArtifactCache) ApplyPutArtifactExpectations(expectations []ArtifactCachePutArtifactExpectation) {
116	for _, e := range expectations {
117		_m.ApplyPutArtifactExpectation(e)
118	}
119}
120
121// PutArtifact provides a mock function with given fields: artifactID, artifactInfo
122func (_m *MockArtifactCache) PutArtifact(artifactID string, artifactInfo types.ArtifactInfo) error {
123	ret := _m.Called(artifactID, artifactInfo)
124
125	var r0 error
126	if rf, ok := ret.Get(0).(func(string, types.ArtifactInfo) error); ok {
127		r0 = rf(artifactID, artifactInfo)
128	} else {
129		r0 = ret.Error(0)
130	}
131
132	return r0
133}
134
135type ArtifactCachePutBlobArgs struct {
136	BlobID           string
137	BlobIDAnything   bool
138	BlobInfo         types.BlobInfo
139	BlobInfoAnything bool
140}
141
142type ArtifactCachePutBlobReturns struct {
143	Err error
144}
145
146type ArtifactCachePutBlobExpectation struct {
147	Args    ArtifactCachePutBlobArgs
148	Returns ArtifactCachePutBlobReturns
149}
150
151func (_m *MockArtifactCache) ApplyPutBlobExpectation(e ArtifactCachePutBlobExpectation) {
152	var args []interface{}
153	if e.Args.BlobIDAnything {
154		args = append(args, mock.Anything)
155	} else {
156		args = append(args, e.Args.BlobID)
157	}
158	if e.Args.BlobInfoAnything {
159		args = append(args, mock.Anything)
160	} else {
161		args = append(args, e.Args.BlobInfo)
162	}
163	_m.On("PutBlob", args...).Return(e.Returns.Err)
164}
165
166func (_m *MockArtifactCache) ApplyPutBlobExpectations(expectations []ArtifactCachePutBlobExpectation) {
167	for _, e := range expectations {
168		_m.ApplyPutBlobExpectation(e)
169	}
170}
171
172// PutBlob provides a mock function with given fields: blobID, blobInfo
173func (_m *MockArtifactCache) PutBlob(blobID string, blobInfo types.BlobInfo) error {
174	ret := _m.Called(blobID, blobInfo)
175
176	var r0 error
177	if rf, ok := ret.Get(0).(func(string, types.BlobInfo) error); ok {
178		r0 = rf(blobID, blobInfo)
179	} else {
180		r0 = ret.Error(0)
181	}
182
183	return r0
184}
185