harbor/src/testing/registryctl/client.go
Chlins Zhang 5deedf4c7c
refactor: unify the mock file generation (#20765)
1. Mock remote interface for distribution manifest by mockery package
feature.
2. Refactor hand-generated mock files to automated management
   generation.
3. Clean useless mocks.

Signed-off-by: chlins <chlins.zhang@gmail.com>
2024-08-05 11:11:05 +00:00

79 lines
1.7 KiB
Go

// Code generated by mockery v2.43.2. DO NOT EDIT.
package registryctl
import mock "github.com/stretchr/testify/mock"
// Client is an autogenerated mock type for the Client type
type Client struct {
mock.Mock
}
// DeleteBlob provides a mock function with given fields: reference
func (_m *Client) DeleteBlob(reference string) error {
ret := _m.Called(reference)
if len(ret) == 0 {
panic("no return value specified for DeleteBlob")
}
var r0 error
if rf, ok := ret.Get(0).(func(string) error); ok {
r0 = rf(reference)
} else {
r0 = ret.Error(0)
}
return r0
}
// DeleteManifest provides a mock function with given fields: repository, reference
func (_m *Client) DeleteManifest(repository string, reference string) error {
ret := _m.Called(repository, reference)
if len(ret) == 0 {
panic("no return value specified for DeleteManifest")
}
var r0 error
if rf, ok := ret.Get(0).(func(string, string) error); ok {
r0 = rf(repository, reference)
} else {
r0 = ret.Error(0)
}
return r0
}
// Health provides a mock function with given fields:
func (_m *Client) Health() error {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Health")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewClient(t interface {
mock.TestingT
Cleanup(func())
}) *Client {
mock := &Client{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}