mock/platform/mock_platform_service.go (296 lines of code) (raw):
// Code generated by mockery v2.42.0. DO NOT EDIT.
package mock
import (
io "io"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
mock "github.com/stretchr/testify/mock"
v1 "github.com/epam/edp-gerrit-operator/v2/api/v1"
)
// PlatformService is an autogenerated mock type for the PlatformService type
type PlatformService struct {
mock.Mock
}
// CreateConfigMap provides a mock function with given fields: instance, configMapName, configMapData
func (_m *PlatformService) CreateConfigMap(instance *v1.Gerrit, configMapName string, configMapData map[string]string) error {
ret := _m.Called(instance, configMapName, configMapData)
if len(ret) == 0 {
panic("no return value specified for CreateConfigMap")
}
var r0 error
if rf, ok := ret.Get(0).(func(*v1.Gerrit, string, map[string]string) error); ok {
r0 = rf(instance, configMapName, configMapData)
} else {
r0 = ret.Error(0)
}
return r0
}
// CreateSecret provides a mock function with given fields: gerrit, name, data, labels
func (_m *PlatformService) CreateSecret(gerrit *v1.Gerrit, name string, data map[string][]byte, labels map[string]string) error {
ret := _m.Called(gerrit, name, data, labels)
if len(ret) == 0 {
panic("no return value specified for CreateSecret")
}
var r0 error
if rf, ok := ret.Get(0).(func(*v1.Gerrit, string, map[string][]byte, map[string]string) error); ok {
r0 = rf(gerrit, name, data, labels)
} else {
r0 = ret.Error(0)
}
return r0
}
// ExecInPod provides a mock function with given fields: namespace, podName, command
func (_m *PlatformService) ExecInPod(namespace string, podName string, command []string) (io.Reader, io.Reader, error) {
ret := _m.Called(namespace, podName, command)
if len(ret) == 0 {
panic("no return value specified for ExecInPod")
}
var r0 io.Reader
var r1 io.Reader
var r2 error
if rf, ok := ret.Get(0).(func(string, string, []string) (io.Reader, io.Reader, error)); ok {
return rf(namespace, podName, command)
}
if rf, ok := ret.Get(0).(func(string, string, []string) io.Reader); ok {
r0 = rf(namespace, podName, command)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(io.Reader)
}
}
if rf, ok := ret.Get(1).(func(string, string, []string) io.Reader); ok {
r1 = rf(namespace, podName, command)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(io.Reader)
}
}
if rf, ok := ret.Get(2).(func(string, string, []string) error); ok {
r2 = rf(namespace, podName, command)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// GenerateKeycloakSettings provides a mock function with given fields: instance
func (_m *PlatformService) GenerateKeycloakSettings(instance *v1.Gerrit) ([]corev1.EnvVar, error) {
ret := _m.Called(instance)
if len(ret) == 0 {
panic("no return value specified for GenerateKeycloakSettings")
}
var r0 []corev1.EnvVar
var r1 error
if rf, ok := ret.Get(0).(func(*v1.Gerrit) ([]corev1.EnvVar, error)); ok {
return rf(instance)
}
if rf, ok := ret.Get(0).(func(*v1.Gerrit) []corev1.EnvVar); ok {
r0 = rf(instance)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]corev1.EnvVar)
}
}
if rf, ok := ret.Get(1).(func(*v1.Gerrit) error); ok {
r1 = rf(instance)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetDeploymentSSHPort provides a mock function with given fields: gerrit
func (_m *PlatformService) GetDeploymentSSHPort(gerrit *v1.Gerrit) (int32, error) {
ret := _m.Called(gerrit)
if len(ret) == 0 {
panic("no return value specified for GetDeploymentSSHPort")
}
var r0 int32
var r1 error
if rf, ok := ret.Get(0).(func(*v1.Gerrit) (int32, error)); ok {
return rf(gerrit)
}
if rf, ok := ret.Get(0).(func(*v1.Gerrit) int32); ok {
r0 = rf(gerrit)
} else {
r0 = ret.Get(0).(int32)
}
if rf, ok := ret.Get(1).(func(*v1.Gerrit) error); ok {
r1 = rf(gerrit)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetExternalEndpoint provides a mock function with given fields: namespace, name
func (_m *PlatformService) GetExternalEndpoint(namespace string, name string) (string, string, error) {
ret := _m.Called(namespace, name)
if len(ret) == 0 {
panic("no return value specified for GetExternalEndpoint")
}
var r0 string
var r1 string
var r2 error
if rf, ok := ret.Get(0).(func(string, string) (string, string, error)); ok {
return rf(namespace, name)
}
if rf, ok := ret.Get(0).(func(string, string) string); ok {
r0 = rf(namespace, name)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(string, string) string); ok {
r1 = rf(namespace, name)
} else {
r1 = ret.Get(1).(string)
}
if rf, ok := ret.Get(2).(func(string, string) error); ok {
r2 = rf(namespace, name)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// GetPods provides a mock function with given fields: namespace, filter
func (_m *PlatformService) GetPods(namespace string, filter *metav1.ListOptions) (*corev1.PodList, error) {
ret := _m.Called(namespace, filter)
if len(ret) == 0 {
panic("no return value specified for GetPods")
}
var r0 *corev1.PodList
var r1 error
if rf, ok := ret.Get(0).(func(string, *metav1.ListOptions) (*corev1.PodList, error)); ok {
return rf(namespace, filter)
}
if rf, ok := ret.Get(0).(func(string, *metav1.ListOptions) *corev1.PodList); ok {
r0 = rf(namespace, filter)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*corev1.PodList)
}
}
if rf, ok := ret.Get(1).(func(string, *metav1.ListOptions) error); ok {
r1 = rf(namespace, filter)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetSecret provides a mock function with given fields: namespace, name
func (_m *PlatformService) GetSecret(namespace string, name string) (map[string][]byte, error) {
ret := _m.Called(namespace, name)
if len(ret) == 0 {
panic("no return value specified for GetSecret")
}
var r0 map[string][]byte
var r1 error
if rf, ok := ret.Get(0).(func(string, string) (map[string][]byte, error)); ok {
return rf(namespace, name)
}
if rf, ok := ret.Get(0).(func(string, string) map[string][]byte); ok {
r0 = rf(namespace, name)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[string][]byte)
}
}
if rf, ok := ret.Get(1).(func(string, string) error); ok {
r1 = rf(namespace, name)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetSecretData provides a mock function with given fields: namespace, name
func (_m *PlatformService) GetSecretData(namespace string, name string) (map[string][]byte, error) {
ret := _m.Called(namespace, name)
if len(ret) == 0 {
panic("no return value specified for GetSecretData")
}
var r0 map[string][]byte
var r1 error
if rf, ok := ret.Get(0).(func(string, string) (map[string][]byte, error)); ok {
return rf(namespace, name)
}
if rf, ok := ret.Get(0).(func(string, string) map[string][]byte); ok {
r0 = rf(namespace, name)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[string][]byte)
}
}
if rf, ok := ret.Get(1).(func(string, string) error); ok {
r1 = rf(namespace, name)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetService provides a mock function with given fields: namespace, name
func (_m *PlatformService) GetService(namespace string, name string) (*corev1.Service, error) {
ret := _m.Called(namespace, name)
if len(ret) == 0 {
panic("no return value specified for GetService")
}
var r0 *corev1.Service
var r1 error
if rf, ok := ret.Get(0).(func(string, string) (*corev1.Service, error)); ok {
return rf(namespace, name)
}
if rf, ok := ret.Get(0).(func(string, string) *corev1.Service); ok {
r0 = rf(namespace, name)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*corev1.Service)
}
}
if rf, ok := ret.Get(1).(func(string, string) error); ok {
r1 = rf(namespace, name)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// IsDeploymentReady provides a mock function with given fields: instance
func (_m *PlatformService) IsDeploymentReady(instance *v1.Gerrit) (bool, error) {
ret := _m.Called(instance)
if len(ret) == 0 {
panic("no return value specified for IsDeploymentReady")
}
var r0 bool
var r1 error
if rf, ok := ret.Get(0).(func(*v1.Gerrit) (bool, error)); ok {
return rf(instance)
}
if rf, ok := ret.Get(0).(func(*v1.Gerrit) bool); ok {
r0 = rf(instance)
} else {
r0 = ret.Get(0).(bool)
}
if rf, ok := ret.Get(1).(func(*v1.Gerrit) error); ok {
r1 = rf(instance)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// PatchDeploymentEnv provides a mock function with given fields: gerrit, env
func (_m *PlatformService) PatchDeploymentEnv(gerrit *v1.Gerrit, env []corev1.EnvVar) error {
ret := _m.Called(gerrit, env)
if len(ret) == 0 {
panic("no return value specified for PatchDeploymentEnv")
}
var r0 error
if rf, ok := ret.Get(0).(func(*v1.Gerrit, []corev1.EnvVar) error); ok {
r0 = rf(gerrit, env)
} else {
r0 = ret.Error(0)
}
return r0
}
// UpdateService provides a mock function with given fields: svc, port
func (_m *PlatformService) UpdateService(svc *corev1.Service, port int32) error {
ret := _m.Called(svc, port)
if len(ret) == 0 {
panic("no return value specified for UpdateService")
}
var r0 error
if rf, ok := ret.Get(0).(func(*corev1.Service, int32) error); ok {
r0 = rf(svc, port)
} else {
r0 = ret.Error(0)
}
return r0
}
// NewPlatformService creates a new instance of PlatformService. 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 NewPlatformService(t interface {
mock.TestingT
Cleanup(func())
}) *PlatformService {
mock := &PlatformService{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}