fake

package
v0.0.0-...-9a6dbc9 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ICertificateHandlerMock

type ICertificateHandlerMock struct {
	// DecodeFunc mocks the Decode method.
	DecodeFunc func(data []byte) (*pem.Block, []byte)

	// ParseFunc mocks the Parse method.
	ParseFunc func(der []byte) (*x509.Certificate, error)
	// contains filtered or unexported fields
}

ICertificateHandlerMock is a mock implementation of certificates.ICertificateHandler.

func TestSomethingThatUsesICertificateHandler(t *testing.T) {

	// make and configure a mocked certificates.ICertificateHandler
	mockedICertificateHandler := &ICertificateHandlerMock{
		DecodeFunc: func(data []byte) (*pem.Block, []byte) {
			panic("mock out the Decode method")
		},
		ParseFunc: func(der []byte) (*x509.Certificate, error) {
			panic("mock out the Parse method")
		},
	}

	// use mockedICertificateHandler in code that requires certificates.ICertificateHandler
	// and then make assertions.

}

func (*ICertificateHandlerMock) Decode

func (mock *ICertificateHandlerMock) Decode(data []byte) (*pem.Block, []byte)

Decode calls DecodeFunc.

func (*ICertificateHandlerMock) DecodeCalls

func (mock *ICertificateHandlerMock) DecodeCalls() []struct {
	Data []byte
}

DecodeCalls gets all the calls that were made to Decode. Check the length with:

len(mockedICertificateHandler.DecodeCalls())

func (*ICertificateHandlerMock) Parse

func (mock *ICertificateHandlerMock) Parse(der []byte) (*x509.Certificate, error)

Parse calls ParseFunc.

func (*ICertificateHandlerMock) ParseCalls

func (mock *ICertificateHandlerMock) ParseCalls() []struct {
	Der []byte
}

ParseCalls gets all the calls that were made to Parse. Check the length with:

len(mockedICertificateHandler.ParseCalls())

type MockCertificateWatcher

type MockCertificateWatcher struct {
	// WaitForCertificatesFunc mocks the WaitForCertificates method.
	WaitForCertificatesFunc func()
	// contains filtered or unexported fields
}

MockCertificateWatcher is a mock implementation of certificates.ICertificateWatcher.

func TestSomethingThatUsesICertificateWatcher(t *testing.T) {

	// make and configure a mocked certificates.ICertificateWatcher
	mockedICertificateWatcher := &MockCertificateWatcher{
		WaitForCertificatesFunc: func()  {
			panic("mock out the WaitForCertificates method")
		},
	}

	// use mockedICertificateWatcher in code that requires certificates.ICertificateWatcher
	// and then make assertions.

}

func (*MockCertificateWatcher) WaitForCertificates

func (mock *MockCertificateWatcher) WaitForCertificates()

WaitForCertificates calls WaitForCertificatesFunc.

func (*MockCertificateWatcher) WaitForCertificatesCalls

func (mock *MockCertificateWatcher) WaitForCertificatesCalls() []struct {
}

WaitForCertificatesCalls gets all the calls that were made to WaitForCertificates. Check the length with:

len(mockedICertificateWatcher.WaitForCertificatesCalls())

Jump to

Keyboard shortcuts

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