Documentation ¶
Overview ¶
Claims unit tests
Index ¶
Constants ¶
const CreateClaimRequest = `
{
"ttl": 3600,
"grace": 3600
}`
CreateClaimRequest is a sample request to create a claim.
const CreateClaimResponse = `` /* 204-byte string literal not displayed */
CreateClaimResponse is a sample response to a create claim
const GetClaimResponse = `` /* 293-byte string literal not displayed */
GetClaimResponse is a sample response to a get claim
const UpdateClaimRequest = `
{
"ttl": 1200,
"grace": 1600
}`
UpdateClaimRequest is a sample request to update a claim.
Variables ¶
var ClaimID = "51db7067821e727dc24df754"
var CreatedClaim = []claims.Messages{ { Age: 57, Href: fmt.Sprintf("/v2/queues/%s/messages/51db6f78c508f17ddc924357?claim_id=%s", QueueName, ClaimID), TTL: 300, Body: map[string]interface{}{"event": "BackupStarted"}, }, }
CreatedClaim is the result of a create request.
var FirstClaim = claims.Claim{ Age: 50, Href: "/v2/queues/demoqueue/claims/51db7067821e727dc24df754", Messages: []claims.Messages{ { Age: 57, Href: fmt.Sprintf("/v2/queues/%s/messages/51db6f78c508f17ddc924357?claim_id=%s", QueueName, ClaimID), TTL: 300, Body: map[string]interface{}{"event": "BackupStarted"}, }, }, TTL: 50, }
FirstClaim is the result of a get claim.
var QueueName = "FakeTestQueue"
QueueName is the name of the queue
Functions ¶
func HandleCreateSuccessfully ¶
HandleCreateSuccessfully configures the test server to respond to a Create request.
func HandleDeleteSuccessfully ¶
HandleDeleteSuccessfully configures the test server to respond to an Delete request.
func HandleGetSuccessfully ¶
HandleGetSuccessfully configures the test server to respond to a Get request.
func HandleUpdateSuccessfully ¶
HandleUpdateSuccessfully configures the test server to respond to a Update request.
Types ¶
This section is empty.