test

package
v0.0.0-...-bf90f01 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: Apache-2.0 Imports: 18 Imported by: 10

README

= Generating the pair of private/public RSA keys

```
$ openssl genrsa -out test/private_key2.pem 2028
Generating RSA private key, 2028 bit long modulus
.............................+++
..............................+++
e is 65537 (0x10001)
$ openssl rsa -in test/private_key2.pem -pubout -outform PEM -out test/public_key2.pem
writing RSA key
```

Documentation

Index

Constants

View Source
const ClusterURL = "http://api.cluster1"

Variables

This section is empty.

Functions

func AssertError

func AssertError(t require.TestingT, actualError error, checks ...ErrorCheck)

func ExpectRequest

func ExpectRequest(matchers ...gock.MatchFunc) gock.Matcher

func HasBearerWithSub

func HasBearerWithSub(sub string) gock.MatchFunc

func HasBodyContainingObject

func HasBodyContainingObject(object map[interface{}]interface{}) gock.MatchFunc

func HasJWTWithSub

func HasJWTWithSub(sub string) gock.MatchFunc

func LoadTestConfig

func LoadTestConfig(t *testing.T) (*configuration.Data, func())

func NewToken

func NewToken(claims map[string]interface{}, privatekeyFilename string) (*jwt.Token, error)

NewToken creates a new JWT using the given sub claim and signed with the private key in the given filename

func Normalize

func Normalize(url string) string

func PrivateKey

func PrivateKey(filename string) (*rsa.PrivateKey, error)

PrivateKey returns the PrivateKey from the given filename

func PublicKey

func PublicKey(filename string) (*rsa.PublicKey, error)

PublicKey returns the PublicKey from the given filename

func SetEnvironments

func SetEnvironments(environments ...Environment) func()

func SpyOnCalls

func SpyOnCalls(counter *int) gock.Matcher

SpyOnCalls checks the number of calls

func SpyOnCallsMatchFunc

func SpyOnCallsMatchFunc(counter *int) gock.MatchFunc

Types

type Awaitility

type Awaitility struct {
	// contains filtered or unexported fields
}

func WaitWithTimeout

func WaitWithTimeout(timeout time.Duration) Awaitility

func (Awaitility) Until

func (a Awaitility) Until(do func() error) error

type Environment

type Environment struct {
	// contains filtered or unexported fields
}

func Env

func Env(key, value string) Environment

type ErrorCheck

type ErrorCheck func(t require.TestingT, actualError error)

func HasMessage

func HasMessage(expectedMsg string, args ...interface{}) ErrorCheck

func HasMessageContaining

func HasMessageContaining(expectedMsg string, args ...interface{}) ErrorCheck

func IsOfType

func IsOfType(expectedType interface{}) ErrorCheck

type RequestMatcher

type RequestMatcher func(req *http.Request) bool

Directories

Path Synopsis
Package resource is used to manage which tests shall be executed.
Package resource is used to manage which tests shall be executed.

Jump to

Keyboard shortcuts

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