testutil

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCanonical

func GetCanonical(t *testing.T, raw string) string

GetCanonical converts the given JSON string into a canonical JSON.

func GetCanonicalBytes added in v1.0.0

func GetCanonicalBytes(t *testing.T, raw string) []byte

GetCanonicalBytes converts the given JSON string into a canonical JSON (returning the bytes).

func GetExpiryService added in v1.0.0

func GetExpiryService(t *testing.T) *expiry.Service

GetExpiryService returns test expiry service object. For most tests, the expiry service used doesn't really matter this object is just needed to ensure that no nil pointer errors happen when initializing the store.

func GetLoader

func GetLoader(t *testing.T) *ld.DocumentLoader

GetLoader returns document loader.

func GetTaskMgr added in v1.0.0

func GetTaskMgr(t *testing.T) *taskmgr.Manager

GetTaskMgr returns a test task manager service.

func InitTracer added in v1.0.0

func InitTracer(t *testing.T) *trace.TracerProvider

InitTracer creates and registers globally a new TracerProvider.

func MarshalCanonical added in v1.0.0

func MarshalCanonical(t *testing.T, i interface{}) []byte

MarshalCanonical marshals the given object to a canonical JSON.

func MustParseURL

func MustParseURL(raw string) *url.URL

MustParseURL parses the given string and returns the URL. If the given string is not a valid URL then the function panics.

func NewMockID

func NewMockID(iri fmt.Stringer, path string) *url.URL

NewMockID returns a URL using the base IRI and the given path.

func NewMockURLs

func NewMockURLs(num int, getURI func(i int) string) []*url.URL

NewMockURLs returns the given number of URLs using the given function to format each one.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL