test

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ApiMocks = map[string]string{
		"Post_201_Created":        "{\"data\":{\"attributes\":{\"alternative_names\":null,\"bank_id\":\"400300\",\"bank_id_code\":\"GBDSC\",\"base_currency\":\"GBP\",\"bic\":\"NWBKGB22\",\"country\":\"GB\",\"name\":[\"Chuchu Cartagena\"]},\"created_on\":\"2022-04-20T18:42:11.427Z\",\"id\":\"ad27e265-9605-4b4b-a0e5-3003ea0cc0da\",\"modified_on\":\"2022-04-20T18:42:11.427Z\",\"organisation_id\":\"eb0bd6f5-c3f5-44b2-b677-acd23cdde73c\",\"type\":\"accounts\",\"version\":0},\"links\":{\"self\":\"/v1/organisation/accounts/ad27e265-9605-4b4b-a0e5-3003ea0cc0da\"}}",
		"Post_201_UnmarshalError": "{",
		"Post_409_Conflict":       "{\"error_message\":\"Account cannot be created as it violates a duplicate constraint\"}",
		"Get_404_NotFound":        "{\"error_message\":\"record ad27e265-9605-4b4b-a0e5-3003ea0cc0da does not exist\"}",

		"Delete_204_NoContent": "",
		"Delete_404_NotFound":  "",
		"Delete_409_Conflict":  "{\"error_message\":\"invalid version\"}",
	}
)

Functions

func IsMockOn

func IsMockOn() bool

func NewAccountRequestWithID

func NewAccountRequestWithID() *model.AccountRequest

func NewAccountRequestWithoutID

func NewAccountRequestWithoutID() *model.AccountRequest

func RestClientMock

func RestClientMock(err error, mocks Mocks, ID string) httpclient.Client

Types

type Mock

type Mock struct {
	Method     string
	HttpStatus int
	Response   string
}

type Mocks

type Mocks []Mock

Jump to

Keyboard shortcuts

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