consumer

package
v0.0.0-...-eae4b23 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2019 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository interface {
	// consume message from broker within given topic
	// will loop forever
	Consume(topic string)
}

Repository function contract for customer repo

type RepositoryMock

type RepositoryMock struct {
	// ConsumeFunc mocks the Consume method.
	ConsumeFunc func(topic string)
	// contains filtered or unexported fields
}

RepositoryMock is a mock implementation of Repository.

    func TestSomethingThatUsesRepository(t *testing.T) {

        // make and configure a mocked Repository
        mockedRepository := &RepositoryMock{
            ConsumeFunc: func(topic string)  {
	               panic("mock out the Consume method")
            },
        }

        // use mockedRepository in code that requires Repository
        // and then make assertions.

    }

func (*RepositoryMock) Consume

func (mock *RepositoryMock) Consume(topic string)

Consume calls ConsumeFunc.

func (*RepositoryMock) ConsumeCalls

func (mock *RepositoryMock) ConsumeCalls() []struct {
	Topic string
}

ConsumeCalls gets all the calls that were made to Consume. Check the length with:

len(mockedRepository.ConsumeCalls())

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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