testutils

package
v0.0.0-...-c6cd810 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEqualConsumption

func AssertEqualConsumption(
	actual *models.ConsumtionValue,
	expected *models.ConsumtionValue,
	t *testing.T,
	testIndex int)

AssertEqualConsumption fails the test if the given consumption values are not equal.

func AssertEqualIndex

func AssertEqualIndex(actual *models.IndexValue, expected *models.IndexValue, t *testing.T, testIndex int)

AssertEqualIndex fails the test if the given index values are not equal.

func AssertEqualSmcData

func AssertEqualSmcData(actual *models.SmcData, expected *models.SmcData, t *testing.T, testIndex int)

AssertEqualSmcData fails the test if the given smc datas are not equal.

func AssertEqualSmcEvent

func AssertEqualSmcEvent(actual *models.SmcEvent, expected *models.SmcEvent, t *testing.T, testIndex int)

AssertEqualSmcEvent fails the test if the given smc events are not equal.

Types

type TestRabbitConsumer

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

func NewTestRabbitConsumer

func NewTestRabbitConsumer(
	hostURL string,
	routingKey string,
	exchangeName string,
	queueName string) *TestRabbitConsumer

Creates a new TestRabbitConsumer.

func (*TestRabbitConsumer) CloseConnectionAndChannel

func (c *TestRabbitConsumer) CloseConnectionAndChannel()

CloseConnection closes the connection.

func (*TestRabbitConsumer) Connect

func (c *TestRabbitConsumer) Connect()

Connect initializes a connection.

func (*TestRabbitConsumer) ConsumeMessages

func (c *TestRabbitConsumer) ConsumeMessages() <-chan amqp.Delivery

ConsumeMessages consumes messages from rabbitmq, returns the deliveries.

type TestRabbitMqProducer

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

TestRabbitMqProducer implements the MessageProducer interface.

func NewTestProducer

func NewTestProducer(
	rabbitMqURL string,
	exchangeName string,
	routingKey string) *TestRabbitMqProducer

NewTestProducer creates a new message producer that publishes messages to rabbitmq.

func (*TestRabbitMqProducer) CloseChannelAndConnection

func (producer *TestRabbitMqProducer) CloseChannelAndConnection()

CloseChannelAndConnection closes the channel and connection received in params.

func (*TestRabbitMqProducer) Connect

func (producer *TestRabbitMqProducer) Connect()

OpenChannelAndConnection opens a channel and a connection.

func (*TestRabbitMqProducer) PublishEntry

func (producer *TestRabbitMqProducer) PublishEntry(line parsermodels.ParsedLogEntry)

PublishEntry sends the parsed log lines to the message queue.

func (*TestRabbitMqProducer) PublishStringMessage

func (producer *TestRabbitMqProducer) PublishStringMessage(message string)

PublishStringMessage sends a string message to the message queue.

Jump to

Keyboard shortcuts

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