forked from mirror/pages-server
123 lines
2.6 KiB
Go
123 lines
2.6 KiB
Go
// Code generated by mockery v2.20.0. DO NOT EDIT.
|
|
|
|
package database
|
|
|
|
import (
|
|
certificate "github.com/go-acme/lego/v4/certificate"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// MockCertDB is an autogenerated mock type for the CertDB type
|
|
type MockCertDB struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// Close provides a mock function with given fields:
|
|
func (_m *MockCertDB) Close() error {
|
|
ret := _m.Called()
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func() error); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Delete provides a mock function with given fields: key
|
|
func (_m *MockCertDB) Delete(key string) error {
|
|
ret := _m.Called(key)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string) error); ok {
|
|
r0 = rf(key)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Get provides a mock function with given fields: name
|
|
func (_m *MockCertDB) Get(name string) (*certificate.Resource, error) {
|
|
ret := _m.Called(name)
|
|
|
|
var r0 *certificate.Resource
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string) (*certificate.Resource, error)); ok {
|
|
return rf(name)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string) *certificate.Resource); ok {
|
|
r0 = rf(name)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*certificate.Resource)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
r1 = rf(name)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Items provides a mock function with given fields: page, pageSize
|
|
func (_m *MockCertDB) Items(page int, pageSize int) ([]*Cert, error) {
|
|
ret := _m.Called(page, pageSize)
|
|
|
|
var r0 []*Cert
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(int, int) ([]*Cert, error)); ok {
|
|
return rf(page, pageSize)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(int, int) []*Cert); ok {
|
|
r0 = rf(page, pageSize)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*Cert)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(int, int) error); ok {
|
|
r1 = rf(page, pageSize)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Put provides a mock function with given fields: name, cert
|
|
func (_m *MockCertDB) Put(name string, cert *certificate.Resource) error {
|
|
ret := _m.Called(name, cert)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string, *certificate.Resource) error); ok {
|
|
r0 = rf(name, cert)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
type mockConstructorTestingTNewMockCertDB interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}
|
|
|
|
// NewMockCertDB creates a new instance of MockCertDB. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
func NewMockCertDB(t mockConstructorTestingTNewMockCertDB) *MockCertDB {
|
|
mock := &MockCertDB{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|