testing

package
v1.3.0 Latest Latest
Warning

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

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

Documentation

Overview

queues unit tests

Index

Constants

View Source
const CreatePurgeRequest = `
{
    "resource_types": ["messages", "subscriptions"]
}`

CreatePurgeRequest is a sample request to a purge.

View Source
const CreateQueueRequest = `` /* 309-byte string literal not displayed */

CreateQueueRequest is a sample request to create a queue.

View Source
const CreateShareRequest = `` /* 137-byte string literal not displayed */

CreateShareRequest is a sample request to a share.

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

CreateShareResponse is a sample response to a share request.

View Source
const GetQueueResponse = `
{
	"_max_messages_post_size": 262144,
	"_default_message_ttl": 3600,
	"description": "Queue used for unit testing."
}`

GetQueueResponse is a sample response to a get queue.

View Source
const GetStatsResponse = `
{
    "messages":{
         "claimed": 10,
         "total": 20,
         "free": 10
    }
}`

GetStatsResponse is a sample response to a stats request.

View Source
const ListQueuesResponse1 = `` /* 655-byte string literal not displayed */

ListQueuesResponse1 is a sample response to a List queues.

View Source
const ListQueuesResponse2 = `` /* 603-byte string literal not displayed */

ListQueuesResponse2 is a sample response to a List queues.

View Source
const UpdateQueueRequest = `` /* 126-byte string literal not displayed */

UpdateQueueRequest is a sample request to update a queue.

View Source
const UpdateQueueResponse = `
{
	"description": "Update queue description"
}`

UpdateQueueResponse is a sample response to a update queue.

Variables

View Source
var ExpectedQueueSlice = [][]queues.Queue{{FirstQueue}, {SecondQueue}}

ExpectedQueueSlice is the expected result in a List.

View Source
var ExpectedShare = queues.QueueShare{
	Project: "2887aabf368046a3bb0070f1c0413470",
	Paths: []string{
		"/v2/queues/test/messages",
		"/v2/queues/test/claims",
		"/v2/queues/test/subscriptions",
	},
	Expires: "2016-09-01T00:00:00",
	Methods: []string{
		"GET",
		"PATCH",
		"POST",
		"PUT",
	},
	Signature: "6a63d63242ebd18c3518871dda6fdcb6273db2672c599bf985469241e9a1c799",
}

ExpectedShare is the expected result in Share.

View Source
var ExpectedStats = queues.Stats{
	Claimed: 10,
	Total:   20,
	Free:    10,
}

ExpectedStats is the expected result in a GetStats.

View Source
var FirstQueue = queues.Queue{
	Href: "/v2/queues/london",
	Name: "london",
	Metadata: queues.QueueDetails{
		DeadLetterQueue:           "fake_queue",
		DeadLetterQueueMessageTTL: 3500,
		DefaultMessageDelay:       25,
		DefaultMessageTTL:         3700,
		MaxClaimCount:             10,
		MaxMessagesPostSize:       262143,
		EnableEncryptMessages:     true,
		Extra:                     map[string]interface{}{"description": "Test queue."},
	},
}

FirstQueue is the first result in a List.

View Source
var QueueDetails = queues.QueueDetails{
	DefaultMessageTTL:   3600,
	MaxMessagesPostSize: 262144,
	Extra:               map[string]interface{}{"description": "Queue used for unit testing."},
}

QueueDetails is the expected result in a Get.

View Source
var QueueName = "FakeTestQueue"

QueueName is the name of the queue

View Source
var SecondQueue = queues.Queue{
	Href: "/v2/queues/beijing",
	Name: "beijing",
	Metadata: queues.QueueDetails{
		DeadLetterQueue:           "fake_queue",
		DeadLetterQueueMessageTTL: 3500,
		DefaultMessageDelay:       25,
		DefaultMessageTTL:         3700,
		MaxClaimCount:             10,
		MaxMessagesPostSize:       262143,
		Extra:                     map[string]interface{}{"description": "Test queue."},
	},
}

SecondQueue is the second result in a List.

Functions

func HandleCreateSuccessfully

func HandleCreateSuccessfully(t *testing.T)

HandleCreateSuccessfully configures the test server to respond to a Create request.

func HandleDeleteSuccessfully

func HandleDeleteSuccessfully(t *testing.T)

HandleDeleteSuccessfully configures the test server to respond to a Delete request.

func HandleGetStatsSuccessfully

func HandleGetStatsSuccessfully(t *testing.T)

HandleGetSuccessfully configures the test server to respond to a Get request.

func HandleGetSuccessfully

func HandleGetSuccessfully(t *testing.T)

HandleGetSuccessfully configures the test server to respond to a Get request.

func HandleListSuccessfully

func HandleListSuccessfully(t *testing.T)

HandleListSuccessfully configures the test server to respond to a List request.

func HandlePurgeSuccessfully

func HandlePurgeSuccessfully(t *testing.T)

HandlePurgeSuccessfully configures the test server to respond to a Purge request.

func HandleShareSuccessfully

func HandleShareSuccessfully(t *testing.T)

HandleShareSuccessfully configures the test server to respond to a Share request.

func HandleUpdateSuccessfully

func HandleUpdateSuccessfully(t *testing.T)

HandleUpdateSuccessfully configures the test server to respond to an 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