testing

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const CreateOutput = `` /* 930-byte string literal not displayed */
View Source
const CreateRequest = `` /* 799-byte string literal not displayed */
View Source
const GetOutput = CreateOutput
View Source
const ListOutput = `` /* 1221-byte string literal not displayed */
View Source
const UpdateOutput = `` /* 938-byte string literal not displayed */
View Source
const UpdateRequest = `` /* 805-byte string literal not displayed */

Variables

View Source
var ExpectedMappingsSlice = []federation.Mapping{MappingACME}

ExpectedMappingsSlice is the slice of mappings expected to be returned from ListOutput.

View Source
var MappingACME = federation.Mapping{
	ID: "ACME",
	Links: map[string]interface{}{
		"self": "http://example.com/identity/v3/OS-FEDERATION/mappings/ACME",
	},
	Rules: []federation.MappingRule{
		{
			Local: []federation.RuleLocal{
				{
					User: &federation.RuleUser{
						Name: "{0}",
					},
				},
				{
					Group: &federation.Group{
						ID: "0cd5e9",
					},
				},
			},
			Remote: []federation.RuleRemote{
				{
					Type: "UserName",
				},
				{
					Type: "orgPersonType",
					NotAnyOf: []string{
						"Contractor",
						"Guest",
					},
				},
			},
		},
	},
}
View Source
var MappingUpdated = federation.Mapping{
	ID: "ACME",
	Links: map[string]interface{}{
		"self": "http://example.com/identity/v3/OS-FEDERATION/mappings/ACME",
	},
	Rules: []federation.MappingRule{
		{
			Local: []federation.RuleLocal{
				{
					User: &federation.RuleUser{
						Name: "{0}",
					},
				},
				{
					Group: &federation.Group{
						ID: "0cd5e9",
					},
				},
			},
			Remote: []federation.RuleRemote{
				{
					Type: "UserName",
				},
				{
					Type: "orgPersonType",
					AnyOneOf: []string{
						"Contractor",
						"SubContractor",
					},
				},
			},
		},
	},
}

Functions

func HandleCreateMappingSuccessfully added in v1.2.0

func HandleCreateMappingSuccessfully(t *testing.T)

HandleCreateMappingSuccessfully creates an HTTP handler at `/mappings` on the test handler mux that tests mapping creation.

func HandleDeleteMappingSuccessfully added in v1.3.0

func HandleDeleteMappingSuccessfully(t *testing.T)

HandleDeleteMappingSuccessfully creates an HTTP handler at `/mappings` on the test handler mux that tests mapping deletion.

func HandleGetMappingSuccessfully added in v1.3.0

func HandleGetMappingSuccessfully(t *testing.T)

HandleGetMappingSuccessfully creates an HTTP handler at `/mappings` on the test handler mux that responds with a single mapping.

func HandleListMappingsSuccessfully

func HandleListMappingsSuccessfully(t *testing.T)

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

func HandleUpdateMappingSuccessfully added in v1.3.0

func HandleUpdateMappingSuccessfully(t *testing.T)

HandleUpdateMappingSuccessfully creates an HTTP handler at `/mappings` on the test handler mux that tests mapping update.

Types

This section is empty.

Jump to

Keyboard shortcuts

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