mocks

package
v2.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertContainsSlackBlocks

func AssertContainsSlackBlocks(t *testing.T, slackClient *SlackClient, message msg.Ref, block slack.Block)

AssertContainsSlackBlocks is a small test helper to check for certain slack.Block

func AssertError

func AssertError(slackClient *SlackClient, ref msg.Ref, errorIn interface{})

AssertError is a test helper which check for calls to "ReplyError"

func AssertQueuedMessage

func AssertQueuedMessage(t *testing.T, expected msg.Message)

AssertQueuedMessage checks if a given internal message was queued

func AssertReaction

func AssertReaction(slackClient *SlackClient, reaction string, ref msg.Ref)

AssertReaction is a test helper to expect a given slack reaction to be added

func AssertRemoveReaction

func AssertRemoveReaction(slackClient *SlackClient, reaction string, ref msg.Ref)

AssertRemoveReaction is a test helper to expect a given slack reaction to be removed

func AssertSlackBlocks

func AssertSlackBlocks(t *testing.T, slackClient *SlackClient, message msg.Ref, expectedJSON string)

AssertSlackBlocks test helper to assert a given JSON representation of "Blocks"

func AssertSlackJSON

func AssertSlackJSON(t *testing.T, slackClient *SlackClient, message msg.Ref, expected string)

AssertSlackJSON is a test helper to assert full slack attachments

func AssertSlackMessage

func AssertSlackMessage(slackClient *SlackClient, ref msg.Ref, text string)

AssertSlackMessage is a test helper to check for a given slack message

func LockInternalMessages

func LockInternalMessages() *sync.Mutex

LockInternalMessages uses mutex to block other tests dealing with the central message queue

func WaitTillHavingInternalMessage

func WaitTillHavingInternalMessage()

WaitTillHavingInternalMessage blocks until there is a internal message queued

Types

type Client

type Client struct {
	mock.Mock
}

Client is an autogenerated mock type for the Client type

func (*Client) BuildJob

func (_m *Client) BuildJob(ctx context.Context, name string, params map[string]string) (int64, error)

BuildJob provides a mock function with given fields: ctx, name, params

func (*Client) GetAllNodes

func (_m *Client) GetAllNodes(ctx context.Context) ([]*gojenkins.Node, error)

GetAllNodes provides a mock function with given fields: ctx

func (*Client) GetJob

func (_m *Client) GetJob(ctx context.Context, id string, parentIDs ...string) (*gojenkins.Job, error)

GetJob provides a mock function with given fields: ctx, id, parentIDs

type SlackClient

type SlackClient struct {
	mock.Mock
}

SlackClient is an autogenerated mock type for the SlackClient type

func (*SlackClient) AddReaction

func (_m *SlackClient) AddReaction(reaction util.Reaction, ref msg.Ref)

AddReaction provides a mock function with given fields: reaction, ref

func (*SlackClient) CanHandleInteractions

func (_m *SlackClient) CanHandleInteractions() bool

CanHandleInteractions provides a mock function with given fields:

func (*SlackClient) GetConversationHistory

GetConversationHistory provides a mock function with given fields: _a0

func (*SlackClient) GetReactions

func (_m *SlackClient) GetReactions(item slack.ItemRef, params slack.GetReactionsParameters) ([]slack.ItemReaction, error)

GetReactions provides a mock function with given fields: item, params

func (*SlackClient) RemoveReaction

func (_m *SlackClient) RemoveReaction(reaction util.Reaction, ref msg.Ref)

RemoveReaction provides a mock function with given fields: reaction, ref

func (*SlackClient) ReplyError

func (_m *SlackClient) ReplyError(ref msg.Ref, err error)

ReplyError provides a mock function with given fields: ref, err

func (*SlackClient) SendBlockMessage

func (_m *SlackClient) SendBlockMessage(ref msg.Ref, blocks []slack.Block, options ...slack.MsgOption) string

SendBlockMessage provides a mock function with given fields: ref, blocks, options

func (*SlackClient) SendMessage

func (_m *SlackClient) SendMessage(ref msg.Ref, text string, options ...slack.MsgOption) string

SendMessage provides a mock function with given fields: ref, text, options

func (*SlackClient) SendToUser

func (_m *SlackClient) SendToUser(user string, text string)

SendToUser provides a mock function with given fields: user, text

Jump to

Keyboard shortcuts

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