Documentation ¶
Index ¶
- type TestHelper
- func (tc *TestHelper) AssertTransportURLDoesNotExist(name types.NamespacedName)
- func (tc *TestHelper) CreateMemcached(namespace string, memcachedName string, spec memcachedv1.MemcachedSpec) types.NamespacedName
- func (tc *TestHelper) DeleteMemcached(name types.NamespacedName)
- func (tc *TestHelper) GetMemcached(name types.NamespacedName) *memcachedv1.Memcached
- func (tc *TestHelper) GetTransportURL(name types.NamespacedName) *rabbitmqv1.TransportURL
- func (tc *TestHelper) SimulateMemcachedReady(name types.NamespacedName)
- func (tc *TestHelper) SimulateTransportURLReady(name types.NamespacedName)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestHelper ¶
type TestHelper struct {
*base.TestHelper
}
TestHelper is a collection of helpers for testing operators. It extends the generic TestHelper from modules/test.
func NewTestHelper ¶
func NewTestHelper( ctx context.Context, k8sClient client.Client, timeout time.Duration, interval time.Duration, logger logr.Logger, ) *TestHelper
NewTestHelper returns a TestHelper
func (*TestHelper) AssertTransportURLDoesNotExist ¶
func (tc *TestHelper) AssertTransportURLDoesNotExist(name types.NamespacedName)
AssertTransportURLDoesNotExist ensures the TransportURL resource does not exist in a k8s cluster.
func (*TestHelper) CreateMemcached ¶
func (tc *TestHelper) CreateMemcached(namespace string, memcachedName string, spec memcachedv1.MemcachedSpec) types.NamespacedName
CreateMemcached creates a new Memcached instance with the specified namespace in the Kubernetes cluster.
func (*TestHelper) DeleteMemcached ¶
func (tc *TestHelper) DeleteMemcached(name types.NamespacedName)
DeleteMemcached deletes a Memcached instance from the Kubernetes cluster.
func (*TestHelper) GetMemcached ¶
func (tc *TestHelper) GetMemcached(name types.NamespacedName) *memcachedv1.Memcached
GetMemcached waits for and retrieves a Memcached instance from the Kubernetes cluster
func (*TestHelper) GetTransportURL ¶
func (tc *TestHelper) GetTransportURL(name types.NamespacedName) *rabbitmqv1.TransportURL
GetTransportURL retrieves a TransportURL resource with the specified name.
Example usage:
th.GetTransportURL(types.NamespacedName{Name: "test-transporturl", Namespace: "test-namespace"})
func (*TestHelper) SimulateMemcachedReady ¶
func (tc *TestHelper) SimulateMemcachedReady(name types.NamespacedName)
SimulateMemcachedReady simulates a ready state for a Memcached instance in a Kubernetes cluster.
func (*TestHelper) SimulateTransportURLReady ¶
func (tc *TestHelper) SimulateTransportURLReady(name types.NamespacedName)
SimulateTransportURLReady function retrieves the TransportURL and simulates the readiness of a TransportURL resource.
Example usage:
th.SimulateTransportURLReady(types.NamespacedName{Name: "test-transporturl", Namespace: "test-namespace"})