google_api_firebase_rules v0.2.0 GoogleApi.FirebaseRules.V1.Model.TestCase View Source

`TestCase` messages provide the request context and an expectation as to whether the given context will be allowed or denied. Test cases may specify the `request`, `resource`, and `function_mocks` to mock a function call to a service-provided function. The `request` object represents context present at request-time. The `resource` is the value of the target resource as it appears in persistent storage before the request is executed.

Attributes

  • expectation (String.t): Test expectation. Defaults to: null.

    • Enum - one of [EXPECTATION_UNSPECIFIED, ALLOW, DENY]
  • functionMocks ([FunctionMock]): Optional function mocks for service-defined functions. If not set, any service defined function is expected to return an error, which may or may not influence the test outcome. Defaults to: null.
  • request (String.t): Request context. The exact format of the request context is service-dependent. See the appropriate service documentation for information about the supported fields and types on the request. Minimally, all services support the following fields and types: Request field | Type ———————-|————————- auth.uid | `string` auth.token | `map<string, string>` headers | `map<string, string>` method | `string` params | `map<string, string>` path | `string` time | `google.protobuf.Timestamp` If the request value is not well-formed for the service, the request will be rejected as an invalid argument. Defaults to: null.
  • resource (String.t): Optional resource value as it appears in persistent storage before the request is fulfilled. The resource type depends on the `request.path` value. Defaults to: null.

Link to this section Summary

Functions

Unwrap a decoded JSON object into its complex fields

Link to this section Types

Link to this type t() View Source
t() :: %GoogleApi.FirebaseRules.V1.Model.TestCase{
  expectation: any(),
  functionMocks: [GoogleApi.FirebaseRules.V1.Model.FunctionMock.t()],
  request: any(),
  resource: any()
}

Link to this section Functions

Link to this function decode(value, options) View Source
decode(struct(), keyword()) :: struct()

Unwrap a decoded JSON object into its complex fields.