Class MockInput

    • Method Detail

      • result

        public final String result()

        A JSON string containing the mocked result of the state invocation.

        Returns:
        A JSON string containing the mocked result of the state invocation.
      • errorOutput

        public final MockErrorOutput errorOutput()

        The mocked error output when calling TestState. When specified, the mocked response is returned as a JSON object that contains an error and cause field.

        Returns:
        The mocked error output when calling TestState. When specified, the mocked response is returned as a JSON object that contains an error and cause field.
      • fieldValidationMode

        public final MockResponseValidationMode fieldValidationMode()

        Determines the level of strictness when validating mocked results against their respective API models. Values include:

        • STRICT: All required fields must be present, and all present fields must conform to the API's schema.

        • PRESENT: All present fields must conform to the API's schema.

        • NONE: No validation is performed.

        If no value is specified, the default value is STRICT.

        If the service returns an enum value that is not available in the current SDK version, fieldValidationMode will return MockResponseValidationMode.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from fieldValidationModeAsString().

        Returns:
        Determines the level of strictness when validating mocked results against their respective API models. Values include:

        • STRICT: All required fields must be present, and all present fields must conform to the API's schema.

        • PRESENT: All present fields must conform to the API's schema.

        • NONE: No validation is performed.

        If no value is specified, the default value is STRICT.

        See Also:
        MockResponseValidationMode
      • fieldValidationModeAsString

        public final String fieldValidationModeAsString()

        Determines the level of strictness when validating mocked results against their respective API models. Values include:

        • STRICT: All required fields must be present, and all present fields must conform to the API's schema.

        • PRESENT: All present fields must conform to the API's schema.

        • NONE: No validation is performed.

        If no value is specified, the default value is STRICT.

        If the service returns an enum value that is not available in the current SDK version, fieldValidationMode will return MockResponseValidationMode.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from fieldValidationModeAsString().

        Returns:
        Determines the level of strictness when validating mocked results against their respective API models. Values include:

        • STRICT: All required fields must be present, and all present fields must conform to the API's schema.

        • PRESENT: All present fields must conform to the API's schema.

        • NONE: No validation is performed.

        If no value is specified, the default value is STRICT.

        See Also:
        MockResponseValidationMode
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • toString

        public final String toString()
        Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
        Overrides:
        toString in class Object
      • getValueForField

        public final <T> Optional<T> getValueForField​(String fieldName,
                                                      Class<T> clazz)