Documentation ¶
Index ¶
- func FindResponseSchema(t *testing.T, paths []*framework.Path, pathIdx int, ...) *framework.Response
- func GetResponseSchema(t *testing.T, path *framework.Path, operation logical.Operation) *framework.Response
- func ResponseValidatingCallback(t *testing.T) func(logical.Backend, *logical.Request, *logical.Response)
- func ValidateResponse(t *testing.T, schema *framework.Response, response *logical.Response, ...)
- func ValidateResponseData(t *testing.T, schema *framework.Response, data map[string]interface{}, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindResponseSchema ¶
func FindResponseSchema(t *testing.T, paths []*framework.Path, pathIdx int, operation logical.Operation) *framework.Response
FindResponseSchema is a test helper to extract response schema from the given framework path / operation.
func GetResponseSchema ¶ added in v0.8.0
func ResponseValidatingCallback ¶ added in v0.9.0
func ResponseValidatingCallback(t *testing.T) func(logical.Backend, *logical.Request, *logical.Response)
ResponseValidatingCallback can be used in setting up a vault.TestCluster that validates every response against the openapi specifications.
func ValidateResponse ¶
func ValidateResponse(t *testing.T, schema *framework.Response, response *logical.Response, strict bool)
ValidateResponse is a test helper that validates whether the given response object conforms to the response schema (schema.Fields). It cycles through the data map and validates conversions in the schema. In "strict" mode, this function will also ensure that the data map has all schema-required fields and does not have any fields outside of the schema.
func ValidateResponseData ¶
func ValidateResponseData(t *testing.T, schema *framework.Response, data map[string]interface{}, strict bool)
ValidateResponseData is a test helper that validates whether the given response data map conforms to the response schema (schema.Fields). It cycles through the data map and validates conversions in the schema. In "strict" mode, this function will also ensure that the data map has all schema's requred fields and does not have any fields outside of the schema.
Types ¶
This section is empty.