Help us shape the future of Go! Take the 2026 Go Developer Survey

testing

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

l7policies unit tests

Index

Constants

View Source
const L7PoliciesListBody = `` /* 1010-byte string literal not displayed */

L7PoliciesListBody contains the canned body of a l7policy list response.

View Source
const PostUpdateL7PolicyBody = `` /* 398-byte string literal not displayed */

PostUpdateL7PolicyBody is the canned response body of a Update request on an existing l7policy.

View Source
const PostUpdateL7PolicyNullRedirectURLBody = `` /* 374-byte string literal not displayed */

PostUpdateL7PolicyNullRedirectURLBody is the canned response body of a Update request on an existing l7policy with a null redirect_url .

View Source
const PostUpdateRuleBody = `` /* 254-byte string literal not displayed */

PostUpdateRuleBody is the canned response body of a Update request on an existing rule.

View Source
const RulesListBody = `` /* 664-byte string literal not displayed */

RulesListBody contains the canned body of a rule list response.

View Source
const SingleL7PolicyBody = `` /* 395-byte string literal not displayed */

SingleL7PolicyBody is the canned body of a Get request on an existing l7policy.

View Source
const SingleRuleBody = `` /* 245-byte string literal not displayed */

SingleRuleBody is the canned body of a Get request on an existing rule.

Variables

View Source
var (
	L7PolicyToURL = l7policies.L7Policy{
		ID:             "8a1412f0-4c32-4257-8b07-af4770b604fd",
		Name:           "redirect-example.com",
		ListenerID:     "023f2e34-7806-443b-bfae-16c324569a3d",
		Action:         "REDIRECT_TO_URL",
		Position:       1,
		Description:    "",
		ProjectID:      "e3cd678b11784734bc366148aa37580e",
		RedirectPoolID: "",
		RedirectURL:    "http://www.example.com",
		AdminStateUp:   true,
		Rules:          []l7policies.Rule{},
	}
	L7PolicyToPool = l7policies.L7Policy{
		ID:             "964f4ba4-f6cd-405c-bebd-639460af7231",
		Name:           "redirect-pool",
		ListenerID:     "be3138a3-5cf7-4513-a4c2-bb137e668bab",
		Action:         "REDIRECT_TO_POOL",
		Position:       1,
		Description:    "",
		ProjectID:      "c1f7910086964990847dc6c8b128f63c",
		RedirectPoolID: "bac433c6-5bea-4311-80da-bd1cd90fbd25",
		RedirectURL:    "",
		AdminStateUp:   true,
		Rules:          []l7policies.Rule{},
	}
	L7PolicyUpdated = l7policies.L7Policy{
		ID:             "8a1412f0-4c32-4257-8b07-af4770b604fd",
		Name:           "NewL7PolicyName",
		ListenerID:     "023f2e34-7806-443b-bfae-16c324569a3d",
		Action:         "REDIRECT_TO_URL",
		Position:       1,
		Description:    "Redirect requests to example.com",
		ProjectID:      "e3cd678b11784734bc366148aa37580e",
		RedirectPoolID: "",
		RedirectURL:    "http://www.new-example.com",
		AdminStateUp:   true,
		Rules:          []l7policies.Rule{},
	}
	L7PolicyNullRedirectURLUpdated = l7policies.L7Policy{
		ID:             "8a1412f0-4c32-4257-8b07-af4770b604fd",
		Name:           "NewL7PolicyName",
		ListenerID:     "023f2e34-7806-443b-bfae-16c324569a3d",
		Action:         "REDIRECT_TO_URL",
		Position:       1,
		Description:    "Redirect requests to example.com",
		ProjectID:      "e3cd678b11784734bc366148aa37580e",
		RedirectPoolID: "",
		RedirectURL:    "",
		AdminStateUp:   true,
		Rules:          []l7policies.Rule{},
	}
	RulePath = l7policies.Rule{
		ID:           "16621dbb-a736-4888-a57a-3ecd53df784c",
		RuleType:     "PATH",
		CompareType:  "REGEX",
		Value:        "/images*",
		ProjectID:    "e3cd678b11784734bc366148aa37580e",
		Key:          "",
		Invert:       true,
		AdminStateUp: true,
	}
	RuleHostName = l7policies.Rule{
		ID:           "d24521a0-df84-4468-861a-a531af116d1e",
		RuleType:     "HOST_NAME",
		CompareType:  "EQUAL_TO",
		Value:        "www.example.com",
		ProjectID:    "e3cd678b11784734bc366148aa37580e",
		Key:          "",
		Invert:       false,
		AdminStateUp: true,
	}
	RuleUpdated = l7policies.Rule{
		ID:           "16621dbb-a736-4888-a57a-3ecd53df784c",
		RuleType:     "PATH",
		CompareType:  "REGEX",
		Value:        "/images/special*",
		ProjectID:    "e3cd678b11784734bc366148aa37580e",
		Key:          "",
		Invert:       false,
		AdminStateUp: true,
	}
)

Functions

func HandleL7PolicyCreationSuccessfully

func HandleL7PolicyCreationSuccessfully(t *testing.T, response string)

HandleL7PolicyCreationSuccessfully sets up the test server to respond to a l7policy creation request with a given response.

func HandleL7PolicyDeletionSuccessfully

func HandleL7PolicyDeletionSuccessfully(t *testing.T)

HandleL7PolicyDeletionSuccessfully sets up the test server to respond to a l7policy deletion request.

func HandleL7PolicyGetSuccessfully

func HandleL7PolicyGetSuccessfully(t *testing.T)

HandleL7PolicyGetSuccessfully sets up the test server to respond to a l7policy Get request.

func HandleL7PolicyListSuccessfully

func HandleL7PolicyListSuccessfully(t *testing.T)

HandleL7PolicyListSuccessfully sets up the test server to respond to a l7policy List request.

func HandleL7PolicyUpdateNullRedirectURLSuccessfully

func HandleL7PolicyUpdateNullRedirectURLSuccessfully(t *testing.T)

HandleL7PolicyUpdateNullRedirectURLSuccessfully sets up the test server to respond to a l7policy Update request.

func HandleL7PolicyUpdateSuccessfully

func HandleL7PolicyUpdateSuccessfully(t *testing.T)

HandleL7PolicyUpdateSuccessfully sets up the test server to respond to a l7policy Update request.

func HandleRuleCreationSuccessfully

func HandleRuleCreationSuccessfully(t *testing.T, response string)

HandleRuleCreationSuccessfully sets up the test server to respond to a rule creation request with a given response.

func HandleRuleDeletionSuccessfully

func HandleRuleDeletionSuccessfully(t *testing.T)

HandleRuleDeletionSuccessfully sets up the test server to respond to a rule deletion request.

func HandleRuleGetSuccessfully

func HandleRuleGetSuccessfully(t *testing.T)

HandleRuleGetSuccessfully sets up the test server to respond to a rule Get request.

func HandleRuleListSuccessfully

func HandleRuleListSuccessfully(t *testing.T)

HandleRuleListSuccessfully sets up the test server to respond to a rule List request.

func HandleRuleUpdateSuccessfully

func HandleRuleUpdateSuccessfully(t *testing.T)

HandleRuleUpdateSuccessfully sets up the test server to respond to a rule Update request.

Types

This section is empty.

Jump to

Keyboard shortcuts

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