mocks

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Code generated by counterfeiter. DO NOT EDIT.

Code generated by counterfeiter. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	ExecuteStub func(request channel.Request, options ...channel.RequestOption) (channel.Response, error)

	InvokeHandlerStub func(handler invoke.Handler, request channel.Request, options ...channel.RequestOption) (channel.Response, error)

	QueryStub func(request channel.Request, options ...channel.RequestOption) (channel.Response, error)

	RegisterChaincodeEventStub func(chainCodeID string, eventFilter string) (fab.Registration, <-chan *fab.CCEvent, error)

	UnregisterChaincodeEventStub func(registration fab.Registration)
	// contains filtered or unexported fields
}

func (*Channel) Execute

func (fake *Channel) Execute(request channel.Request, options ...channel.RequestOption) (channel.Response, error)

func (*Channel) ExecuteArgsForCall

func (fake *Channel) ExecuteArgsForCall(i int) (channel.Request, []channel.RequestOption)

func (*Channel) ExecuteCallCount

func (fake *Channel) ExecuteCallCount() int

func (*Channel) ExecuteReturns

func (fake *Channel) ExecuteReturns(result1 channel.Response, result2 error)

func (*Channel) ExecuteReturnsOnCall

func (fake *Channel) ExecuteReturnsOnCall(i int, result1 channel.Response, result2 error)

func (*Channel) Invocations

func (fake *Channel) Invocations() map[string][][]interface{}

func (*Channel) InvokeHandler

func (fake *Channel) InvokeHandler(handler invoke.Handler, request channel.Request, options ...channel.RequestOption) (channel.Response, error)

func (*Channel) InvokeHandlerArgsForCall

func (fake *Channel) InvokeHandlerArgsForCall(i int) (invoke.Handler, channel.Request, []channel.RequestOption)

func (*Channel) InvokeHandlerCallCount

func (fake *Channel) InvokeHandlerCallCount() int

func (*Channel) InvokeHandlerReturns

func (fake *Channel) InvokeHandlerReturns(result1 channel.Response, result2 error)

func (*Channel) InvokeHandlerReturnsOnCall

func (fake *Channel) InvokeHandlerReturnsOnCall(i int, result1 channel.Response, result2 error)

func (*Channel) Query

func (fake *Channel) Query(request channel.Request, options ...channel.RequestOption) (channel.Response, error)

func (*Channel) QueryArgsForCall

func (fake *Channel) QueryArgsForCall(i int) (channel.Request, []channel.RequestOption)

func (*Channel) QueryCallCount

func (fake *Channel) QueryCallCount() int

func (*Channel) QueryReturns

func (fake *Channel) QueryReturns(result1 channel.Response, result2 error)

func (*Channel) QueryReturnsOnCall

func (fake *Channel) QueryReturnsOnCall(i int, result1 channel.Response, result2 error)

func (*Channel) RegisterChaincodeEvent

func (fake *Channel) RegisterChaincodeEvent(chainCodeID string, eventFilter string) (fab.Registration, <-chan *fab.CCEvent, error)

func (*Channel) RegisterChaincodeEventArgsForCall

func (fake *Channel) RegisterChaincodeEventArgsForCall(i int) (string, string)

func (*Channel) RegisterChaincodeEventCallCount

func (fake *Channel) RegisterChaincodeEventCallCount() int

func (*Channel) RegisterChaincodeEventReturns

func (fake *Channel) RegisterChaincodeEventReturns(result1 fab.Registration, result2 <-chan *fab.CCEvent, result3 error)

func (*Channel) RegisterChaincodeEventReturnsOnCall

func (fake *Channel) RegisterChaincodeEventReturnsOnCall(i int, result1 fab.Registration, result2 <-chan *fab.CCEvent, result3 error)

func (*Channel) UnregisterChaincodeEvent

func (fake *Channel) UnregisterChaincodeEvent(registration fab.Registration)

func (*Channel) UnregisterChaincodeEventArgsForCall

func (fake *Channel) UnregisterChaincodeEventArgsForCall(i int) fab.Registration

func (*Channel) UnregisterChaincodeEventCallCount

func (fake *Channel) UnregisterChaincodeEventCallCount() int

type Factory

type Factory struct {
	SDKStub func() (fabric.SDK, error)

	ChannelStub func() (fabric.Channel, error)

	EventStub func() (fabric.Event, error)

	LedgerStub func() (fabric.Ledger, error)

	ResourceManagementStub func() (fabric.ResourceManagement, error)

	MSPStub func() (fabric.MSP, error)
	// contains filtered or unexported fields
}

func (*Factory) Channel

func (fake *Factory) Channel() (fabric.Channel, error)

func (*Factory) ChannelCallCount

func (fake *Factory) ChannelCallCount() int

func (*Factory) ChannelReturns

func (fake *Factory) ChannelReturns(result1 fabric.Channel, result2 error)

func (*Factory) ChannelReturnsOnCall

func (fake *Factory) ChannelReturnsOnCall(i int, result1 fabric.Channel, result2 error)

func (*Factory) Event

func (fake *Factory) Event() (fabric.Event, error)

func (*Factory) EventCallCount

func (fake *Factory) EventCallCount() int

func (*Factory) EventReturns

func (fake *Factory) EventReturns(result1 fabric.Event, result2 error)

func (*Factory) EventReturnsOnCall

func (fake *Factory) EventReturnsOnCall(i int, result1 fabric.Event, result2 error)

func (*Factory) Invocations

func (fake *Factory) Invocations() map[string][][]interface{}

func (*Factory) Ledger

func (fake *Factory) Ledger() (fabric.Ledger, error)

func (*Factory) LedgerCallCount

func (fake *Factory) LedgerCallCount() int

func (*Factory) LedgerReturns

func (fake *Factory) LedgerReturns(result1 fabric.Ledger, result2 error)

func (*Factory) LedgerReturnsOnCall

func (fake *Factory) LedgerReturnsOnCall(i int, result1 fabric.Ledger, result2 error)

func (*Factory) MSP

func (fake *Factory) MSP() (fabric.MSP, error)

func (*Factory) MSPCallCount

func (fake *Factory) MSPCallCount() int

func (*Factory) MSPReturns

func (fake *Factory) MSPReturns(result1 fabric.MSP, result2 error)

func (*Factory) MSPReturnsOnCall

func (fake *Factory) MSPReturnsOnCall(i int, result1 fabric.MSP, result2 error)

func (*Factory) ResourceManagement

func (fake *Factory) ResourceManagement() (fabric.ResourceManagement, error)

func (*Factory) ResourceManagementCallCount

func (fake *Factory) ResourceManagementCallCount() int

func (*Factory) ResourceManagementReturns

func (fake *Factory) ResourceManagementReturns(result1 fabric.ResourceManagement, result2 error)

func (*Factory) ResourceManagementReturnsOnCall

func (fake *Factory) ResourceManagementReturnsOnCall(i int, result1 fabric.ResourceManagement, result2 error)

func (*Factory) SDK

func (fake *Factory) SDK() (fabric.SDK, error)

func (*Factory) SDKCallCount

func (fake *Factory) SDKCallCount() int

func (*Factory) SDKReturns

func (fake *Factory) SDKReturns(result1 fabric.SDK, result2 error)

func (*Factory) SDKReturnsOnCall

func (fake *Factory) SDKReturnsOnCall(i int, result1 fabric.SDK, result2 error)

type MockResponseBody

type MockResponseBody struct {
	Bytes []byte
	Err   error
}

MockResponseBody implements a mock io.ReadCloser

func NewResponseBody

func NewResponseBody(content []byte) *MockResponseBody

NewResponseBody returns a new mock response body

func (*MockResponseBody) Close

func (m *MockResponseBody) Close() error

Close mocks out the Close func

func (*MockResponseBody) Read

func (m *MockResponseBody) Read(p []byte) (int, error)

Read reads from the byte array

type MockTransport

type MockTransport struct {
	GetResponse  *http.Response
	GetErr       error
	PostResponse *http.Response
	PostErr      error
}

MockTransport implements a mock HTTP transport

func NewTransport

func NewTransport() *MockTransport

NewTransport returns a mock transport

func (*MockTransport) RoundTrip

func (m *MockTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements http.RoundTripper

func (*MockTransport) WithGetError

func (m *MockTransport) WithGetError(err error) *MockTransport

WithGetError injects an error

func (*MockTransport) WithGetResponse

func (m *MockTransport) WithGetResponse(resp *http.Response) *MockTransport

WithGetResponse sets the mock response for a Get

func (*MockTransport) WithPostError

func (m *MockTransport) WithPostError(err error) *MockTransport

WithPostError injects an error

func (*MockTransport) WithPostResponse

func (m *MockTransport) WithPostResponse(resp *http.Response) *MockTransport

WithPostResponse sets the mock response for a Post

type Reader

type Reader struct {
	Bytes []byte
}

Reader provides a byte array from which the reader reads

func (*Reader) Read

func (r *Reader) Read(p []byte) (n int, err error)

Read reads from the byte array

type Writer

type Writer struct {
	Bytes []byte
	Err   error
}

Writer captures the written bytes so that they may be examined in unit tests

func (*Writer) Write

func (w *Writer) Write(p []byte) (int, error)

Write saves the given bytes

func (*Writer) Written

func (w *Writer) Written() string

Written returns the written bytes as a string (minus any newline characters)

Jump to

Keyboard shortcuts

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