testUtils

package
v1.2.1-0...-e31c98a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package testUtils is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockSdkOperations

type MockSdkOperations struct {
	// contains filtered or unexported fields
}

MockSdkOperations is a mock of SdkOperations interface

func CreateMock

func CreateMock(t *testing.T) (*gomock.Controller, *MockSdkOperations)

func NewMockSdkOperations

func NewMockSdkOperations(ctrl *gomock.Controller) *MockSdkOperations

NewMockSdkOperations creates a new mock instance

func (*MockSdkOperations) Create

func (m *MockSdkOperations) Create(o runtime.Object) error

Create mocks base method

func (*MockSdkOperations) Delete

func (m *MockSdkOperations) Delete(o runtime.Object, opts ...interface{}) error

Delete mocks base method

func (*MockSdkOperations) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockSdkOperations) Get

Get mocks base method

func (*MockSdkOperations) List

func (m *MockSdkOperations) List(namespace string, o runtime.Object) error

List mocks base method

func (*MockSdkOperations) Update

func (m *MockSdkOperations) Update(o runtime.Object) error

Update mocks base method

func (*MockSdkOperations) WithDeleteOptions

func (m *MockSdkOperations) WithDeleteOptions(metaDeleteOptions *v1.DeleteOptions) interface{}

WithDeleteOptions mocks base method

type MockSdkOperationsMockRecorder

type MockSdkOperationsMockRecorder struct {
	// contains filtered or unexported fields
}

MockSdkOperationsMockRecorder is the mock recorder for MockSdkOperations

func (*MockSdkOperationsMockRecorder) Create

func (mr *MockSdkOperationsMockRecorder) Create(o interface{}) *gomock.Call

Create indicates an expected call of Create

func (*MockSdkOperationsMockRecorder) Delete

func (mr *MockSdkOperationsMockRecorder) Delete(o interface{}, opts ...interface{}) *gomock.Call

Delete indicates an expected call of Delete

func (*MockSdkOperationsMockRecorder) Get

func (mr *MockSdkOperationsMockRecorder) Get(o interface{}) *gomock.Call

Get indicates an expected call of Get

func (*MockSdkOperationsMockRecorder) List

func (mr *MockSdkOperationsMockRecorder) List(namespace, o interface{}) *gomock.Call

List indicates an expected call of List

func (*MockSdkOperationsMockRecorder) Update

func (mr *MockSdkOperationsMockRecorder) Update(o interface{}) *gomock.Call

Update indicates an expected call of Update

func (*MockSdkOperationsMockRecorder) WithDeleteOptions

func (mr *MockSdkOperationsMockRecorder) WithDeleteOptions(metaDeleteOptions interface{}) *gomock.Call

WithDeleteOptions indicates an expected call of WithDeleteOptions

type SdkMockStateful

type SdkMockStateful struct {
	// contains filtered or unexported fields
}

SdkMockStateful sdk operator mock that creates, updates, gets and deletes CRs. Note that the implementation doesn't perform all checks a full kubernetes would do. For example, for an update, a k8s would check if the resourceVersion of the stored object matches the version of the new version.

func NewSdkMockBackedByFake

func NewSdkMockBackedByFake(t *testing.T, k8sCs kubernetes.Interface) *SdkMockStateful

NewSdkMockBackedByFake creates a new sdk mock, which keeps state and uses k8s for known CRs. Note that the implementation doesn't perform all checks a full kubernetes would do. For example, for an update, a k8s would check if the resourceVersion of the stored object matches the version of the new version.

func (*SdkMockStateful) Create

func (m *SdkMockStateful) Create(o runtime.Object) error

Create creates the CR

func (*SdkMockStateful) Delete

func (m *SdkMockStateful) Delete(o runtime.Object, opts ...interface{}) error

Delete deletes the CR

func (*SdkMockStateful) Get

func (m *SdkMockStateful) Get(o runtime.Object) error

Get returns the CR

func (*SdkMockStateful) List

func (m *SdkMockStateful) List(namespace string, o runtime.Object) error

List returns nothing

func (*SdkMockStateful) Update

func (m *SdkMockStateful) Update(o runtime.Object) error

Update updates the CR

func (*SdkMockStateful) WithDeleteOptions

func (m *SdkMockStateful) WithDeleteOptions(metaDeleteOptions *metav1.DeleteOptions) interface{}

WithDeleteOptions does nothing

type TestError

type TestError struct {
	Reason metav1.StatusReason
}

func (*TestError) Error

func (err *TestError) Error() string

func (*TestError) Status

func (err *TestError) Status() metav1.Status

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL