Documentation ¶
Overview ¶
messages unit tests
Index ¶
- Constants
- Variables
- func HandleCreateSuccessfully(t *testing.T)
- func HandleDeleteMessagesSuccessfully(t *testing.T)
- func HandleDeleteSuccessfully(t *testing.T)
- func HandleGetMessagesSuccessfully(t *testing.T)
- func HandleGetSuccessfully(t *testing.T)
- func HandleListSuccessfully(t *testing.T)
- func HandlePopSuccessfully(t *testing.T)
Constants ¶
const CreateMessageRequest = `` /* 267-byte string literal not displayed */
CreateMessageRequest is a sample request to create a message.
const CreateMessageResponse = `` /* 148-byte string literal not displayed */
CreateMessageResponse is a sample response to a Create message.
const GetMessageResponse = `` /* 324-byte string literal not displayed */
GetMessageResponse is a sample response to Get.
const GetMessagesResponse = `` /* 378-byte string literal not displayed */
GetMessagesResponse is a sample response to GetMessages.
const ListMessagesResponse1 = `` /* 582-byte string literal not displayed */
ListMessagesResponse is a sample response to list messages.
const ListMessagesResponse2 = `` /* 583-byte string literal not displayed */
ListMessagesResponse is a sample response to list messages.
const PopMessageResponse = `` /* 293-byte string literal not displayed */
PopMessageResponse is a sample reponse to pop messages
Variables ¶
var ExpectedMessagesSet = []messages.Message{ { Body: map[string]interface{}{ "total_bytes": "99614720", "current_bytes": "0", "event": "BackupProgress", }, Age: 443, Href: "/v2/queues/beijing/messages/578f0055508f153f256f717f", ID: "578f0055508f153f256f717f", TTL: 3600, Checksum: "", }, }
ExpectedMessagesSet is the expected result in GetMessages
var ExpectedMessagesSlice = [][]messages.Message{{FirstMessage}, {SecondMessage}}
ExpectedMessagesSlice is the expected result in a List.
var ExpectedPopMessage = []messages.PopMessage{{ Body: map[string]interface{}{ "current_bytes": "0", "event": "BackupProgress", "total_bytes": "99614720", }, Age: 20, TTL: 120, ClaimID: "123456", ClaimCount: 55, ID: "5ae7972599352b436763aee7", }}
ExpectedPopMessage is the expected result of a Pop.
var ExpectedResources = messages.ResourceList{ Resources: []string{ "/v2/queues/demoqueue/messages/51db6f78c508f17ddc924357", "/v2/queues/demoqueue/messages/51db6f78c508f17ddc924358", }, }
ExpectedResources is the expected result in Create
var FirstMessage = messages.Message{ Body: map[string]interface{}{ "current_bytes": "0", "event": "BackupProgress", "total_bytes": "99614720", }, Age: 482, Href: fmt.Sprintf("/v2/queues/%s/messages/578edfe6508f153f256f717b", QueueName), ID: "578edfe6508f153f256f717b", TTL: 3600, Checksum: "MD5:abf7213555626e29c3cb3e5dc58b3515", }
FirstMessage is the first result in a List.
var MessageID = "9988776655"
MessageID is the id of the message
var QueueName = "FakeTestQueue"
QueueName is the name of the queue
var SecondMessage = messages.Message{ Body: map[string]interface{}{ "current_bytes": "0", "event": "BackupProgress", "total_bytes": "99614720", }, Age: 456, Href: fmt.Sprintf("/v2/queues/%s/messages/578ee000508f153f256f717d", QueueName), ID: "578ee000508f153f256f717d", TTL: 3600, Checksum: "MD5:abf7213555626e29c3cb3e5dc58b3515", }
SecondMessage is the second result in a List.
Functions ¶
func HandleCreateSuccessfully ¶
HandleCreateSuccessfully configures the test server to respond to a Create request.
func HandleDeleteMessagesSuccessfully ¶
HandleDeleteMessagesSuccessfully configures the test server to respond to a Delete request.
func HandleDeleteSuccessfully ¶
HandleGetSuccessfully configures the test server to respond to a Get request.
func HandleGetMessagesSuccessfully ¶
HandleGetMessagesSuccessfully configures the test server to respond to a GetMessages 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 HandlePopSuccessfully ¶
HandlePopSuccessfully configures the test server to respond to a Pop request.
Types ¶
This section is empty.