testing

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const CreateConsumerRequest = `
{
  "URL": "http://example.com",
  "name": "CONSUMER-LZILN1zq"
}`
View Source
const CreateConsumerResponse = `` /* 546-byte string literal not displayed */
View Source
const CreateRequest = `` /* 202-byte string literal not displayed */

CreateRequest provides the input to a Create request.

View Source
const CreateResponse = `` /* 461-byte string literal not displayed */

CreateResponse is the response of a Create request.

View Source
const DeleteConsumerRequest = `
{
  "URL": "http://example.com",
  "name": "CONSUMER-LZILN1zq"
}`
View Source
const GetResponse = `` /* 461-byte string literal not displayed */

GetResponse provides a Get result.

View Source
const ListConsumersResponse = `` /* 226-byte string literal not displayed */
View Source
const ListResponse = `` /* 1101-byte string literal not displayed */

ListResponse provides a single page of container results.

Variables

View Source
var ExpectedConsumer = containers.Consumer{
	URL:     "http://example.com",
	Created: time.Date(2018, 6, 22, 16, 26, 25, 0, time.UTC),
	Name:    "CONSUMER-LZILN1zq",
	Status:  "ACTIVE",
	Updated: time.Date(2018, 6, 22, 16, 26, 25, 0, time.UTC),
}

ExpectedConsumer is the expected result of a consumer retrieval.

View Source
var ExpectedConsumersSlice = []containers.Consumer{ExpectedConsumer}

ExpectedConsumersSlice is an expected slice of consumers.

View Source
var ExpectedContainersSlice = []containers.Container{FirstContainer, SecondContainer}

ExpectedContainersSlice is the slice of containers expected to be returned from ListResponse.

View Source
var ExpectedCreatedConsumer = containers.Container{
	Consumers: []containers.ConsumerRef{
		{
			Name: "CONSUMER-LZILN1zq",
			URL:  "http://example.com",
		},
	},
	ContainerRef: "http://barbican:9311/v1/containers/dfdb88f3-4ddb-4525-9da6-066453caa9b0",
	Created:      time.Date(2018, 6, 21, 21, 28, 37, 0, time.UTC),
	CreatorID:    "5c70d99f4a8641c38f8084b32b5e5c0e",
	Name:         "mycontainer",
	SecretRefs: []containers.SecretRef{
		{
			Name:      "mysecret",
			SecretRef: "http://barbican:9311/v1/secrets/1b8068c4-3bb6-4be6-8f1e-da0d1ea0b67c",
		},
	},
	Status:  "ACTIVE",
	Type:    "generic",
	Updated: time.Date(2018, 6, 21, 21, 28, 37, 0, time.UTC),
}

ExpectedCreatedConsumer is the expected result of adding a consumer.

View Source
var FirstContainer = containers.Container{
	Consumers:    []containers.ConsumerRef{},
	ContainerRef: "http://barbican:9311/v1/containers/dfdb88f3-4ddb-4525-9da6-066453caa9b0",
	Created:      time.Date(2018, 6, 21, 21, 28, 37, 0, time.UTC),
	CreatorID:    "5c70d99f4a8641c38f8084b32b5e5c0e",
	Name:         "mycontainer",
	SecretRefs: []containers.SecretRef{
		{
			Name:      "mysecret",
			SecretRef: "http://barbican:9311/v1/secrets/1b8068c4-3bb6-4be6-8f1e-da0d1ea0b67c",
		},
	},
	Status:  "ACTIVE",
	Type:    "generic",
	Updated: time.Date(2018, 6, 21, 21, 28, 37, 0, time.UTC),
}

FirstContainer is the first resource in the List request.

View Source
var SecondContainer = containers.Container{
	Consumers:    []containers.ConsumerRef{},
	ContainerRef: "http://barbican:9311/v1/containers/47b20e73-335b-4867-82dc-3796524d5e20",
	Created:      time.Date(2018, 6, 21, 21, 30, 9, 0, time.UTC),
	CreatorID:    "5c70d99f4a8641c38f8084b32b5e5c0e",
	Name:         "anothercontainer",
	SecretRefs: []containers.SecretRef{
		{
			Name:      "another",
			SecretRef: "http://barbican:9311/v1/secrets/1b12b69a-8822-442e-a303-da24ade648ac",
		},
	},
	Status:  "ACTIVE",
	Type:    "generic",
	Updated: time.Date(2018, 6, 21, 21, 30, 9, 0, time.UTC),
}

SecondContainer is the second resource in the List request.

Functions

func HandleCreateConsumerSuccessfully

func HandleCreateConsumerSuccessfully(t *testing.T)

HandleCreateConsumerSuccessfully creates an HTTP handler at `/containers/uuid/consumers` on the test handler mux that tests resource creation.

func HandleCreateContainerSuccessfully

func HandleCreateContainerSuccessfully(t *testing.T)

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

func HandleDeleteConsumerSuccessfully

func HandleDeleteConsumerSuccessfully(t *testing.T)

HandleDeleteConsumerSuccessfully creates an HTTP handler at `/containers/uuid/consumers` on the test handler mux that tests resource deletion.

func HandleDeleteContainerSuccessfully

func HandleDeleteContainerSuccessfully(t *testing.T)

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

func HandleGetContainerSuccessfully

func HandleGetContainerSuccessfully(t *testing.T)

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

func HandleListConsumersSuccessfully

func HandleListConsumersSuccessfully(t *testing.T)

HandleListConsumersSuccessfully creates an HTTP handler at `/containers/uuid/consumers` on the test handler mux that responds with a list of consumers.

func HandleListContainersSuccessfully

func HandleListContainersSuccessfully(t *testing.T)

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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