acctest

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MockDataSourceWorkspacesBasic = `` /* 327-byte string literal not displayed */

	MockResourceWorkspaceBasicCreate = `` /* 261-byte string literal not displayed */

	MockResourceWorkspaceBasicGet = `` /* 327-byte string literal not displayed */

	MockResourceWorkspaceBasicDelete = `{
  "success": true,
  "message": "resource deleted successfully",
  "revision": 1
}`
	MockResourceWorkspaceWithSourceUpdate = `{
  "success": true,
  "message": "OK",
  "revision": 1
}`
	MockResourceWorkspaceWithSourceGet = `` /* 339-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func AssertMockEndpointsCalls

func AssertMockEndpointsCalls(endpoints []*MockEndpoint) error

AssertMockEndpointsCalls asserts that the number of calls an endpoint got

func NewMockServer

func NewMockServer(t *testing.T, name string, endpoints []*MockEndpoint) *httptest.Server

NewMockServer establishes a httptest server to simulate behaviour of Structurizr Server

Types

type MockEndpoint

type MockEndpoint struct {
	Request  *MockRequest
	Response *MockResponse
	Calls    int
	// contains filtered or unexported fields
}

MockEndpoint represents a basic request and response that can be used for creating simple httptest server routes.

type MockRequest

type MockRequest struct {
	Method string
	Uri    string
	Body   *string
}

MockRequest represents a basic HTTP request

type MockResponse

type MockResponse struct {
	StatusCode  int
	Body        string
	ContentType string
}

MockResponse represents a basic HTTP response.

Jump to

Keyboard shortcuts

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