client

package
v0.43.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KameletRecorder

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

KameletRecorder is recorder for eventing objects

func (*KameletRecorder) CreateKameletBinding

func (sr *KameletRecorder) CreateKameletBinding(binding *camelkapis.KameletBinding, err error)

CreateKameletBinding records a call for CreateKameletBinding with the expected result and error (nil if none)

func (*KameletRecorder) DeleteKameletBinding added in v0.30.0

func (sr *KameletRecorder) DeleteKameletBinding(name string, err error)

DeleteKameletBinding records a call for DeleteKameletBinding with the expected name and error (nil if none)

func (*KameletRecorder) Get

func (sr *KameletRecorder) Get(kamelet *camelkapis.Kamelet, err error)

Get records a call for GetKamelet with the expected result and error (nil if none)

func (*KameletRecorder) GetKameletBinding

func (sr *KameletRecorder) GetKameletBinding(binding *camelkapis.KameletBinding, err error)

GetKameletBinding records a call for Get with the expected result and error (nil if none)

func (*KameletRecorder) List

func (sr *KameletRecorder) List(kameletList *camelkapis.KameletList, err error)

List records a call for ListKamelets with the expected result and error (nil if none)

func (*KameletRecorder) ListBindings

func (sr *KameletRecorder) ListBindings(bindings *camelkapis.KameletBindingList, err error)

List records a call for ListKameletBindings with the expected result and error (nil if none)

func (*KameletRecorder) UpdateKameletBinding

func (sr *KameletRecorder) UpdateKameletBinding(binding *camelkapis.KameletBinding, err error)

UpdateKameletBinding records a call for Update with the expected result and error (nil if none)

func (*KameletRecorder) Validate

func (sr *KameletRecorder) Validate()

Validate validates whether every recorded action has been called

type MockClient

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

MockClient is a combine of test object and recorder

func NewMockClient

func NewMockClient(t *testing.T, ns ...string) *MockClient

NewMockClient returns a new mock instance which you need to record for

func (*MockClient) CamelV1

func (c *MockClient) CamelV1() camelkv1.CamelV1Interface

func (*MockClient) CamelV1alpha1

func (c *MockClient) CamelV1alpha1() *camelkv1alpha1.CamelV1alpha1Interface

func (*MockClient) GetConfig

func (c *MockClient) GetConfig() *rest.Config

func (*MockClient) GetCurrentNamespace

func (c *MockClient) GetCurrentNamespace(kubeConfig string) (string, error)

func (*MockClient) GetScheme

func (c *MockClient) GetScheme() *runtime.Scheme

func (*MockClient) KameletBindings

func (c *MockClient) KameletBindings(namespace string) camelkv1alpha1.KameletBindingInterface

func (*MockClient) Kamelets

func (c *MockClient) Kamelets(namespace string) camelkv1alpha1.KameletInterface

func (*MockClient) RESTClient

func (c *MockClient) RESTClient() rest.Interface

func (*MockClient) Recorder

func (c *MockClient) Recorder() *KameletRecorder

Recorder returns the recorder for registering API calls

type MockKameletBindingsClient

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

MockKameletBindingsClient is a combine of test object and recorder

func (*MockKameletBindingsClient) Create

Create performs a previously recorded action

func (*MockKameletBindingsClient) Delete

func (*MockKameletBindingsClient) DeleteCollection

func (c *MockKameletBindingsClient) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error

func (*MockKameletBindingsClient) Get

Get performs a previously recorded action

func (*MockKameletBindingsClient) List

func (*MockKameletBindingsClient) Patch

func (c *MockKameletBindingsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *camelkapis.KameletBinding, err error)

func (*MockKameletBindingsClient) Update

func (*MockKameletBindingsClient) UpdateStatus

func (*MockKameletBindingsClient) Watch

type MockKameletClient

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

MockKameletClient is a combine of test object and recorder

func (*MockKameletClient) Create

func (*MockKameletClient) Delete

func (c *MockKameletClient) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error

func (*MockKameletClient) DeleteCollection

func (c *MockKameletClient) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error

func (*MockKameletClient) Get

Get performs a previously recorded action

func (*MockKameletClient) List

List performs a previously recorded action

func (*MockKameletClient) Patch

func (c *MockKameletClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *camelkapis.Kamelet, err error)

func (*MockKameletClient) Update

func (*MockKameletClient) UpdateStatus

func (c *MockKameletClient) UpdateStatus(ctx context.Context, kamelet *camelkapis.Kamelet, opts v1.UpdateOptions) (*camelkapis.Kamelet, error)

func (*MockKameletClient) Watch

Jump to

Keyboard shortcuts

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