mocks

package
v0.0.0-...-a27ef0f Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PredefinedTime time.Time

PredefinedTime is a time.Time object that will be returned by Now() function

Functions

func BuildHTTPResponse

func BuildHTTPResponse(statusCode int, body string) *http.Response

BuildHTTPResponse is used in tests

func GetResponse

func GetResponse(testServer *httptest.Server, values url.Values) (int, []byte)

GetResponse is used in tests

func JSONGetResponse

func JSONGetResponse(testServer *httptest.Server, data map[string]interface{}) (int, []byte)

JSONGetResponse is used in tests

func Now

func Now() time.Time

Now is a mocking a method

Types

type HTTPClientInterface

type HTTPClientInterface interface {
	PostForm(url string, data url.Values) (resp *http.Response, err error)
	Get(url string) (resp *http.Response, err error)
}

HTTPClientInterface helps mocking http.Client in tests

type MockDatabase

type MockDatabase struct {
	mock.Mock
}

MockDatabase ...

func (*MockDatabase) DeleteAllowedFIByDomain

func (m *MockDatabase) DeleteAllowedFIByDomain(domain string) error

DeleteAllowedFIByDomain is a mocking a method

func (*MockDatabase) DeleteAllowedUserByDomainAndUserID

func (m *MockDatabase) DeleteAllowedUserByDomainAndUserID(domain, userID string) error

DeleteAllowedUserByDomainAndUserID is a mocking a method

func (*MockDatabase) GetAllowedFIByDomain

func (m *MockDatabase) GetAllowedFIByDomain(domain string) (*db.AllowedFI, error)

GetAllowedFIByDomain is a mocking a method

func (*MockDatabase) GetAllowedUserByDomainAndUserID

func (m *MockDatabase) GetAllowedUserByDomainAndUserID(domain, userID string) (*db.AllowedUser, error)

GetAllowedUserByDomainAndUserID is a mocking a method

func (*MockDatabase) GetAuthData

func (m *MockDatabase) GetAuthData(requestID string) (*db.AuthData, error)

GetAuthData is a mocking a method

func (*MockDatabase) GetAuthorizedTransactionByMemo

func (m *MockDatabase) GetAuthorizedTransactionByMemo(memo string) (*db.AuthorizedTransaction, error)

GetAuthorizedTransactionByMemo is a mocking a method

func (*MockDatabase) InsertAllowedFI

func (m *MockDatabase) InsertAllowedFI(fi *db.AllowedFI) error

InsertAllowedFI is a mocking a method

func (*MockDatabase) InsertAllowedUser

func (m *MockDatabase) InsertAllowedUser(user *db.AllowedUser) error

InsertAllowedUser is a mocking a method

func (*MockDatabase) InsertAuthData

func (m *MockDatabase) InsertAuthData(authData *db.AuthData) error

InsertAuthData is a mocking a method

func (*MockDatabase) InsertAuthorizedTransaction

func (m *MockDatabase) InsertAuthorizedTransaction(transaction *db.AuthorizedTransaction) error

InsertAuthorizedTransaction is a mocking a method

type MockFederationResolver

type MockFederationResolver struct {
	mock.Mock
}

MockFederationResolver ...

func (*MockFederationResolver) ForwardRequest

func (m *MockFederationResolver) ForwardRequest(domain string, fields url.Values) (*fprotocol.NameResponse, error)

ForwardRequest is a mocking a method

func (*MockFederationResolver) LookupByAccountID

func (m *MockFederationResolver) LookupByAccountID(aid string) (*fprotocol.IDResponse, error)

LookupByAccountID is a mocking a method

func (*MockFederationResolver) LookupByAddress

func (m *MockFederationResolver) LookupByAddress(addy string) (*fprotocol.NameResponse, error)

LookupByAddress is a mocking a method

type MockHTTPClient

type MockHTTPClient struct {
	mock.Mock
}

MockHTTPClient ...

func (*MockHTTPClient) Do

func (m *MockHTTPClient) Do(req *http.Request) (resp *http.Response, err error)

Do is a mocking a method

func (*MockHTTPClient) Get

func (m *MockHTTPClient) Get(url string) (resp *http.Response, err error)

Get is a mocking a method

func (*MockHTTPClient) PostForm

func (m *MockHTTPClient) PostForm(url string, data url.Values) (resp *http.Response, err error)

PostForm is a mocking a method

type MockNonceGenerator

type MockNonceGenerator struct{}

func (*MockNonceGenerator) Generate

func (n *MockNonceGenerator) Generate() string

type MockSignerVerifier

type MockSignerVerifier struct {
	mock.Mock
}

MockSignerVerifier ...

func (*MockSignerVerifier) Sign

func (m *MockSignerVerifier) Sign(secretSeed string, message []byte) (string, error)

Sign is a mocking a method

func (*MockSignerVerifier) Verify

func (m *MockSignerVerifier) Verify(publicKey string, message, signature []byte) error

Verify is a mocking a method

type MockStellartomlResolver

type MockStellartomlResolver struct {
	mock.Mock
}

MockStellartomlResolver ...

func (*MockStellartomlResolver) GetStellarToml

func (m *MockStellartomlResolver) GetStellarToml(domain string) (resp *stellartoml.Response, err error)

GetStellarToml is a mocking a method

func (*MockStellartomlResolver) GetStellarTomlByAddress

func (m *MockStellartomlResolver) GetStellarTomlByAddress(addy string) (*stellartoml.Response, error)

GetStellarTomlByAddress is a mocking a method

Jump to

Keyboard shortcuts

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