testing

package
v1.1.31 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const CreateRequest = `` /* 158-byte string literal not displayed */

CreateRequest provides the input to a Create request.

View Source
const GetResponse = `` /* 583-byte string literal not displayed */

GetResponse provides a Get result.

View Source
const ListResponse = `` /* 1347-byte string literal not displayed */

ListResponse provides a single page of RESOURCE results.

Variables

View Source
var ExpectedOrdersSlice = []orders.Order{FirstOrder, SecondOrder}

ExpectedOrdersSlice is the slice of orders expected to be returned from ListResponse.

View Source
var FirstOrder = orders.Order{
	Created:   time.Date(2018, 6, 22, 5, 5, 43, 0, time.UTC),
	CreatorID: "5c70d99f4a8641c38f8084b32b5e5c0e",
	Meta: orders.Meta{
		Algorithm:          "aes",
		BitLength:          256,
		Mode:               "cbc",
		PayloadContentType: "application/octet-stream",
	},
	OrderRef:         "http://barbican:9311/v1/orders/46f73695-82bb-447a-bf96-6635f0fb0ce7",
	SecretRef:        "http://barbican:9311/v1/secrets/22dfef44-1046-4549-a86d-95af462e8fa0",
	Status:           "ACTIVE",
	SubStatus:        "Unknown",
	SubStatusMessage: "Unknown",
	Type:             "key",
	Updated:          time.Date(2018, 6, 22, 5, 5, 43, 0, time.UTC),
}

FirstOrder is the first resource in the List request.

View Source
var SecondOrder = orders.Order{
	Created:   time.Date(2018, 6, 22, 5, 8, 15, 0, time.UTC),
	CreatorID: "5c70d99f4a8641c38f8084b32b5e5c0e",
	Meta: orders.Meta{
		Algorithm:          "aes",
		BitLength:          256,
		Mode:               "cbc",
		PayloadContentType: "application/octet-stream",
	},
	OrderRef:         "http://barbican:9311/v1/orders/07fba88b-3dcf-44e3-a4a3-0bad7f56f01c",
	SecretRef:        "http://barbican:9311/v1/secrets/a31ad551-1aa5-4ba0-810e-0865163e0fa9",
	Status:           "ACTIVE",
	SubStatus:        "Unknown",
	SubStatusMessage: "Unknown",
	Type:             "key",
	Updated:          time.Date(2018, 6, 22, 5, 8, 15, 0, time.UTC),
}

SecondOrder is the second resource in the List request.

Functions

func HandleCreateOrderSuccessfully

func HandleCreateOrderSuccessfully(t *testing.T)

HandleCreateOrderSuccessfully creates an HTTP handler at `/orders` on the test handler mux that tests resource creation.

func HandleDeleteOrderSuccessfully

func HandleDeleteOrderSuccessfully(t *testing.T)

HandleDeleteOrderSuccessfully creates an HTTP handler at `/orders` on the test handler mux that tests resource deletion.

func HandleGetOrderSuccessfully

func HandleGetOrderSuccessfully(t *testing.T)

HandleGetOrderSuccessfully creates an HTTP handler at `/orders` on the test handler mux that responds with a single resource.

func HandleListOrdersSuccessfully

func HandleListOrdersSuccessfully(t *testing.T)

HandleListOrdersSuccessfully creates an HTTP handler at `/orders` on the test handler mux that responds with a list of two orders.

Types

This section is empty.

Jump to

Keyboard shortcuts

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