Documentation ¶
Index ¶
- Constants
- Variables
- type Component
- func (c *Component) Close()
- func (c *Component) GetKafkaConsumer(ctx context.Context, cfg *config.Kafka, topic string) (kafka.IConsumerGroup, error)
- func (c *Component) GetKafkaProducer(_ context.Context, cfg *config.Kafka) (kafka.IProducer, error)
- func (c *Component) RegisterSteps(ctx *godog.ScenarioContext)
- func (c *Component) Reset() error
Constants ¶
View Source
const ContentUpdatedTopic = "content-updated"
View Source
const SearchContentUpdatedTopic = "search-content-updated"
View Source
const (
WaitEventTimeout = 5 * time.Second // maximum time that the component test consumer will wait for a kafka event
)
Variables ¶
View Source
var ( BuildTime = "1625046891" GitCommit = "7434fe334d9f51b7239f978094ea29d10ac33b16" Version = "" )
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct { componenttest.ErrorFeature DatasetAPI *httpfake.HTTPFake // Dataset API mock at HTTP level Zebedee *httpfake.HTTPFake // Zebedee mock at HTTP level KafkaProducer *kafkatest.Producer // Mock for service kafka producer ContentPublishedConsumer *kafkatest.Consumer // Mock for service kafka consumer SearchContentConsumer *kafkatest.Consumer // Mock for service kafka consumer // contains filtered or unexported fields }
func NewComponent ¶
func (*Component) Close ¶
func (c *Component) Close()
Close kills the application under test and waits for it to complete the graceful shutdown, or timeout
func (*Component) GetKafkaConsumer ¶ added in v0.24.0
func (c *Component) GetKafkaConsumer(ctx context.Context, cfg *config.Kafka, topic string) (kafka.IConsumerGroup, error)
GetKafkaConsumer creates a new kafkatest consumer based on the topic and stores it in the Component struct. It returns the appropriate mock for the service under test. If there is any error creating the mock, it is returned.
func (*Component) GetKafkaProducer ¶ added in v0.24.0
GetKafkaProducer creates a new kafkatest producer and stores it to the caller Component struct It returns the mock, so it can be used by the service under test. If there is any error creating the mock, it is also returned to the service.
func (*Component) RegisterSteps ¶
func (c *Component) RegisterSteps(ctx *godog.ScenarioContext)
Click to show internal directories.
Click to hide internal directories.