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// MockLocalArtifactCache is an autogenerated mock type for the LocalArtifactCache type 11type MockLocalArtifactCache struct { 12 mock.Mock 13} 14 15type LocalArtifactCacheClearReturns struct { 16 Err error 17} 18 19type LocalArtifactCacheClearExpectation struct { 20 Returns LocalArtifactCacheClearReturns 21} 22 23func (_m *MockLocalArtifactCache) ApplyClearExpectation(e LocalArtifactCacheClearExpectation) { 24 var args []interface{} 25 _m.On("Clear", args...).Return(e.Returns.Err) 26} 27 28func (_m *MockLocalArtifactCache) ApplyClearExpectations(expectations []LocalArtifactCacheClearExpectation) { 29 for _, e := range expectations { 30 _m.ApplyClearExpectation(e) 31 } 32} 33 34// Clear provides a mock function with given fields: 35func (_m *MockLocalArtifactCache) Clear() error { 36 ret := _m.Called() 37 38 var r0 error 39 if rf, ok := ret.Get(0).(func() error); ok { 40 r0 = rf() 41 } else { 42 r0 = ret.Error(0) 43 } 44 45 return r0 46} 47 48type LocalArtifactCacheCloseReturns struct { 49 Err error 50} 51 52type LocalArtifactCacheCloseExpectation struct { 53 Returns LocalArtifactCacheCloseReturns 54} 55 56func (_m *MockLocalArtifactCache) ApplyCloseExpectation(e LocalArtifactCacheCloseExpectation) { 57 var args []interface{} 58 _m.On("Close", args...).Return(e.Returns.Err) 59} 60 61func (_m *MockLocalArtifactCache) ApplyCloseExpectations(expectations []LocalArtifactCacheCloseExpectation) { 62 for _, e := range expectations { 63 _m.ApplyCloseExpectation(e) 64 } 65} 66 67// Close provides a mock function with given fields: 68func (_m *MockLocalArtifactCache) Close() error { 69 ret := _m.Called() 70 71 var r0 error 72 if rf, ok := ret.Get(0).(func() error); ok { 73 r0 = rf() 74 } else { 75 r0 = ret.Error(0) 76 } 77 78 return r0 79} 80 81type LocalArtifactCacheGetArtifactArgs struct { 82 ArtifactID string 83 ArtifactIDAnything bool 84} 85 86type LocalArtifactCacheGetArtifactReturns struct { 87 ArtifactInfo types.ArtifactInfo 88 Err error 89} 90 91type LocalArtifactCacheGetArtifactExpectation struct { 92 Args LocalArtifactCacheGetArtifactArgs 93 Returns LocalArtifactCacheGetArtifactReturns 94} 95 96func (_m *MockLocalArtifactCache) ApplyGetArtifactExpectation(e LocalArtifactCacheGetArtifactExpectation) { 97 var args []interface{} 98 if e.Args.ArtifactIDAnything { 99 args = append(args, mock.Anything) 100 } else { 101 args = append(args, e.Args.ArtifactID) 102 } 103 _m.On("GetArtifact", args...).Return(e.Returns.ArtifactInfo, e.Returns.Err) 104} 105 106func (_m *MockLocalArtifactCache) ApplyGetArtifactExpectations(expectations []LocalArtifactCacheGetArtifactExpectation) { 107 for _, e := range expectations { 108 _m.ApplyGetArtifactExpectation(e) 109 } 110} 111 112// GetArtifact provides a mock function with given fields: artifactID 113func (_m *MockLocalArtifactCache) GetArtifact(artifactID string) (types.ArtifactInfo, error) { 114 ret := _m.Called(artifactID) 115 116 var r0 types.ArtifactInfo 117 if rf, ok := ret.Get(0).(func(string) types.ArtifactInfo); ok { 118 r0 = rf(artifactID) 119 } else { 120 r0 = ret.Get(0).(types.ArtifactInfo) 121 } 122 123 var r1 error 124 if rf, ok := ret.Get(1).(func(string) error); ok { 125 r1 = rf(artifactID) 126 } else { 127 r1 = ret.Error(1) 128 } 129 130 return r0, r1 131} 132 133type LocalArtifactCacheGetBlobArgs struct { 134 BlobID string 135 BlobIDAnything bool 136} 137 138type LocalArtifactCacheGetBlobReturns struct { 139 BlobInfo types.BlobInfo 140 Err error 141} 142 143type LocalArtifactCacheGetBlobExpectation struct { 144 Args LocalArtifactCacheGetBlobArgs 145 Returns LocalArtifactCacheGetBlobReturns 146} 147 148func (_m *MockLocalArtifactCache) ApplyGetBlobExpectation(e LocalArtifactCacheGetBlobExpectation) { 149 var args []interface{} 150 if e.Args.BlobIDAnything { 151 args = append(args, mock.Anything) 152 } else { 153 args = append(args, e.Args.BlobID) 154 } 155 _m.On("GetBlob", args...).Return(e.Returns.BlobInfo, e.Returns.Err) 156} 157 158func (_m *MockLocalArtifactCache) ApplyGetBlobExpectations(expectations []LocalArtifactCacheGetBlobExpectation) { 159 for _, e := range expectations { 160 _m.ApplyGetBlobExpectation(e) 161 } 162} 163 164// GetBlob provides a mock function with given fields: blobID 165func (_m *MockLocalArtifactCache) GetBlob(blobID string) (types.BlobInfo, error) { 166 ret := _m.Called(blobID) 167 168 var r0 types.BlobInfo 169 if rf, ok := ret.Get(0).(func(string) types.BlobInfo); ok { 170 r0 = rf(blobID) 171 } else { 172 r0 = ret.Get(0).(types.BlobInfo) 173 } 174 175 var r1 error 176 if rf, ok := ret.Get(1).(func(string) error); ok { 177 r1 = rf(blobID) 178 } else { 179 r1 = ret.Error(1) 180 } 181 182 return r0, r1 183} 184