testing

package
v0.25.0 Latest Latest
Warning

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

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

Documentation

Overview

Claims unit tests

Index

Constants

View Source
const CreateClaimRequest = `
{
	"ttl": 3600,
	"grace": 3600
}`

CreateClaimRequest is a sample request to create a claim.

View Source
const CreateClaimResponse = `` /* 204-byte string literal not displayed */

CreateClaimResponse is a sample response to a create claim

View Source
const GetClaimResponse = `` /* 293-byte string literal not displayed */

GetClaimResponse is a sample response to a get claim

View Source
const UpdateClaimRequest = `
{
	"ttl": 1200,
	"grace": 1600
}`

UpdateClaimRequest is a sample request to update a claim.

Variables

View Source
var ClaimID = "51db7067821e727dc24df754"
View Source
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.

View Source
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.

View Source
var QueueName = "FakeTestQueue"

QueueName is the name of the queue

Functions

func HandleCreateNoContent added in v0.11.0

func HandleCreateNoContent(t *testing.T)

HandleCreateNoContent configures the test server to respond to a Create request with no content.

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 an Delete request.

func HandleGetSuccessfully

func HandleGetSuccessfully(t *testing.T)

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

func HandleUpdateSuccessfully

func HandleUpdateSuccessfully(t *testing.T)

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