Documentation ¶
Overview ¶
queues unit tests
Index ¶
- Constants
- Variables
- func HandleCreateSuccessfully(t *testing.T)
- func HandleDeleteSuccessfully(t *testing.T)
- func HandleGetStatsSuccessfully(t *testing.T)
- func HandleGetSuccessfully(t *testing.T)
- func HandleListSuccessfully(t *testing.T)
- func HandlePurgeSuccessfully(t *testing.T)
- func HandleShareSuccessfully(t *testing.T)
- func HandleUpdateSuccessfully(t *testing.T)
Constants ¶
const CreatePurgeRequest = `
{
"resource_types": ["messages", "subscriptions"]
}`
CreatePurgeRequest is a sample request to a purge.
const CreateQueueRequest = `` /* 270-byte string literal not displayed */
CreateQueueRequest is a sample request to create a queue.
CreateShareRequest is a sample request to a share.
CreateShareResponse is a sample response to a share request.
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.
const GetStatsResponse = `
{
"messages":{
"claimed": 10,
"total": 20,
"free": 10
}
}`
GetStatsResponse is a sample response to a stats request.
const ListQueuesResponse1 = `` /* 596-byte string literal not displayed */
ListQueuesResponse1 is a sample response to a List queues.
const ListQueuesResponse2 = `` /* 593-byte string literal not displayed */
ListQueuesResponse2 is a sample response to a List queues.
const UpdateQueueRequest = `` /* 126-byte string literal not displayed */
UpdateQueueRequest is a sample request to update a queue.
const UpdateQueueResponse = `
{
"description": "Update queue description"
}`
UpdateQueueResponse is a sample response to a update queue.
Variables ¶
var ExpectedQueueSlice = [][]queues.Queue{{FirstQueue}, {SecondQueue}}
ExpectedQueueSlice is the expected result in a List.
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", }Project: "2887aabf368046a3bb0070f1c0413470", Paths: []
ExpectedShare is the expected result in Share.
var ExpectedStats = queues.Stats{
Claimed: 10,
Total: 20,
Free: 10,
}
ExpectedStats is the expected result in a GetStats.
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, Extra: map[string]interface{}{"description": "Test queue."}, }, }
FirstQueue is the first result in a List.
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.
var QueueName = "FakeTestQueue"
QueueName is the name of the queue
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 ¶
HandleCreateSuccessfully configures the test server to respond to a Create request.
func HandleDeleteSuccessfully ¶
HandleDeleteSuccessfully configures the test server to respond to a Delete request.
func HandleGetStatsSuccessfully ¶
HandleGetSuccessfully configures the test server to respond to a Get request.
func HandleGetSuccessfully ¶
HandleGetSuccessfully configures the test server to respond to a Get request.
func HandleListSuccessfully ¶
HandleListSuccessfully configures the test server to respond to a List request.
func HandlePurgeSuccessfully ¶
HandlePurgeSuccessfully configures the test server to respond to a Purge request.
func HandleShareSuccessfully ¶
HandleShareSuccessfully configures the test server to respond to a Share request.
func HandleUpdateSuccessfully ¶
HandleUpdateSuccessfully configures the test server to respond to an Update request.
Types ¶
This section is empty.