pub struct TestScriptSetupActionAssertBuilder { /* private fields */ }
Expand description
Builder for TestScriptSetupActionAssert
.
Implementations§
Source§impl TestScriptSetupActionAssertBuilder
impl TestScriptSetupActionAssertBuilder
Sourcepub fn id(self, value: String) -> TestScriptSetupActionAssertBuilder
pub fn id(self, value: String) -> TestScriptSetupActionAssertBuilder
Unique id for inter-element referencing
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
Sourcepub fn extension(
self,
value: Vec<Extension>,
) -> TestScriptSetupActionAssertBuilder
pub fn extension( self, value: Vec<Extension>, ) -> TestScriptSetupActionAssertBuilder
Additional content defined by implementations
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
Sourcepub fn modifier_extension(
self,
value: Vec<Extension>,
) -> TestScriptSetupActionAssertBuilder
pub fn modifier_extension( self, value: Vec<Extension>, ) -> TestScriptSetupActionAssertBuilder
Extensions that cannot be ignored even if unrecognized
May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element’s descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
Sourcepub fn label(self, value: String) -> TestScriptSetupActionAssertBuilder
pub fn label(self, value: String) -> TestScriptSetupActionAssertBuilder
Tracking/logging assertion label
The label would be used for tracking/logging purposes by test engines.
This has no impact on the verification itself.
Sourcepub fn label_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn label_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn description(self, value: String) -> TestScriptSetupActionAssertBuilder
pub fn description(self, value: String) -> TestScriptSetupActionAssertBuilder
Tracking/reporting assertion description
The description would be used by test engines for tracking and reporting purposes.
This has no impact on the verification itself.
Sourcepub fn description_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn description_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn direction(
self,
value: AssertionDirectionType,
) -> TestScriptSetupActionAssertBuilder
pub fn direction( self, value: AssertionDirectionType, ) -> TestScriptSetupActionAssertBuilder
AssertionDirectionType; response | request
The direction to use for the assertion.
If the direction is specified as “response” (the default), then the processing of this assert is against the received response message. If the direction is specified as “request”, then the processing of this assert is against the sent request message.
Sourcepub fn direction_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn direction_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn compare_to_source_id(
self,
value: String,
) -> TestScriptSetupActionAssertBuilder
pub fn compare_to_source_id( self, value: String, ) -> TestScriptSetupActionAssertBuilder
Id of the source fixture to be evaluated
Id of the source fixture used as the contents to be evaluated by either the “source/expression” or “sourceId/path” definition.
Sourcepub fn compare_to_source_id_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn compare_to_source_id_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn compare_to_source_expression(
self,
value: String,
) -> TestScriptSetupActionAssertBuilder
pub fn compare_to_source_expression( self, value: String, ) -> TestScriptSetupActionAssertBuilder
The FHIRPath expression to evaluate against the source fixture
The FHIRPath expression for a specific value to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.
Thefhirpath expression to be evaluated against the expected fixture to compare to. Ignored if “assert.value” is used. The evaluation will be done before the assertion is evaluated.
Sourcepub fn compare_to_source_expression_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn compare_to_source_expression_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn compare_to_source_path(
self,
value: String,
) -> TestScriptSetupActionAssertBuilder
pub fn compare_to_source_path( self, value: String, ) -> TestScriptSetupActionAssertBuilder
XPath or JSONPath expression to evaluate against the source fixture
XPath or JSONPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.
The XPath or JSONPath expression to be evaluated against the expected fixture to compare to. Ignored if “assert.value” is used. The evaluation will be done before the assertion is evaluated.
Sourcepub fn compare_to_source_path_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn compare_to_source_path_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn content_type(self, value: String) -> TestScriptSetupActionAssertBuilder
pub fn content_type(self, value: String) -> TestScriptSetupActionAssertBuilder
MimeType; Mime type to compare against the ‘Content-Type’ header
The mime-type contents to compare against the request or response message ‘Content-Type’ header.
If this is specified, then test engine shall confirm that the content-type of the last operation’s headers is set to this value. If “assert.sourceId” element is specified, then the evaluation will be done against the headers mapped to that sourceId (and not the last operation’s headers). If you’d like to have more control over the string, then use ‘assert.headerField’ instead.
Sourcepub fn content_type_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn content_type_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn default_manual_completion(
self,
value: AssertionManualCompletionType,
) -> TestScriptSetupActionAssertBuilder
pub fn default_manual_completion( self, value: AssertionManualCompletionType, ) -> TestScriptSetupActionAssertBuilder
AssertionManualCompletionType; fail | pass | skip | stop
The default manual completion outcome applied to this assertion.
Manual completion is used to pause the test engine execution and evaluation allowing an external review of the defined assert condition. The defaultManualCompletion defines the default manual completion outcome applied if one of the enumerated values is not applied.
Sourcepub fn default_manual_completion_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn default_manual_completion_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn expression(self, value: String) -> TestScriptSetupActionAssertBuilder
pub fn expression(self, value: String) -> TestScriptSetupActionAssertBuilder
The FHIRPath expression to be evaluated
The FHIRPath expression to be evaluated against the request or response message contents - HTTP headers and payload.
If both “expression” and a “fixtureId” are specified, then the expression will be evaluated against the request or response body mapped to the fixtureId. If “expression” is specified and a “fixtureId” is not, then the expression will be evaluated against the response body of the last operation. Test engines are to store the request and response body and headers of the last operation at all times for subsequent assertions.
The FHIRPath expression can be evaluated as either a path to a specific value or as a boolean expression against the given FHIR resource. When the FHIRPath is a boolean expression, the assert.value element is not used. See Testing FHIR Use Expressions.
Sourcepub fn expression_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn expression_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn header_field(self, value: String) -> TestScriptSetupActionAssertBuilder
pub fn header_field(self, value: String) -> TestScriptSetupActionAssertBuilder
HTTP header field name
The HTTP header field name e.g. ‘Location’.
If “headerField” is specified then “value” must be specified. If “sourceId” is not specified, then “headerField” will be evaluated against the last operation’s response headers. Test engines are to keep track of the last operation’s response body and response headers.
Sourcepub fn header_field_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn header_field_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn minimum_id(self, value: String) -> TestScriptSetupActionAssertBuilder
pub fn minimum_id(self, value: String) -> TestScriptSetupActionAssertBuilder
Fixture Id of minimum content resource
The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId.
Asserts that the response contains all the element/content in another fixture pointed to by minimumId. This can be a statically defined fixture or one that is dynamically set via responseId.
See Testing FHIR Use minimumId for a more complete description of the test engine’s comparison logic.
Sourcepub fn minimum_id_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn minimum_id_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Perform validation on navigation links?
Whether or not the test execution performs validation on the bundle navigation links.
Asserts that the Bundle contains first, last, and next links.
Extension field.
Sourcepub fn operator(
self,
value: AssertionOperatorType,
) -> TestScriptSetupActionAssertBuilder
pub fn operator( self, value: AssertionOperatorType, ) -> TestScriptSetupActionAssertBuilder
AssertionOperatorType; equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains | eval | manualEval
The operator type defines the conditional behavior of the assert.
Operators are useful for both positive and negative testing. If operator is not specified, then the default conditional behavior is implemented as defined in Testing FHIR Assertions.
Sourcepub fn operator_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn operator_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn path(self, value: String) -> TestScriptSetupActionAssertBuilder
pub fn path(self, value: String) -> TestScriptSetupActionAssertBuilder
XPath or JSONPath expression
The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.
If both “path” and a “fixtureId” are specified, then the path will be evaluated against the request or response body mapped to the fixtureId. If “path” is specified and a “fixtureId” is not, then the path will be evaluated against the response body of the last operation. Test engines are to store the request and response body and headers of the last operation at all times for subsequent assertions.
Sourcepub fn path_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn path_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn request_method(
self,
value: TestScriptRequestMethodCode,
) -> TestScriptSetupActionAssertBuilder
pub fn request_method( self, value: TestScriptRequestMethodCode, ) -> TestScriptSetupActionAssertBuilder
TestScriptRequestMethodCode; delete | get | options | patch | post | put | head
The request method or HTTP operation code to compare against that used by the client system under test.
If “requestMethod” is specified then it will be used in place of “value”. The “requestMethod” will evaluate against the last operation’s request HTTP operation.
Sourcepub fn request_method_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn request_method_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn request_url(self, value: String) -> TestScriptSetupActionAssertBuilder
pub fn request_url(self, value: String) -> TestScriptSetupActionAssertBuilder
Request URL comparison value
The value to use in a comparison against the request URL path string.
If “requestURL” is specified then it will be used in place of “value”. The “requestURL” will evaluate against the last operation’s full request URL path string.
Sourcepub fn request_url_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn request_url_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn resource(self, value: String) -> TestScriptSetupActionAssertBuilder
pub fn resource(self, value: String) -> TestScriptSetupActionAssertBuilder
FHIRConcreteType; Resource type
The type of the resource. See the resource list.
This will be expected resource type in response body e.g. in read, vread, search, etc. See the Resource List for complete list of resource types; e.g.
Sourcepub fn resource_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn resource_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn response(
self,
value: AssertionResponseTypes,
) -> TestScriptSetupActionAssertBuilder
pub fn response( self, value: AssertionResponseTypes, ) -> TestScriptSetupActionAssertBuilder
AssertionResponseTypes; continue | switchingProtocols | okay | created | accepted | nonAuthoritativeInformation | noContent | resetContent | partialContent | multipleChoices | movedPermanently | found | seeOther | notModified | useProxy | temporaryRedirect | permanentRedirect | badRequest | unauthorized | paymentRequired | forbidden | notFound | methodNotAllowed | notAcceptable | proxyAuthenticationRequired | requestTimeout | conflict | gone | lengthRequired | preconditionFailed | contentTooLarge | uriTooLong | unsupportedMediaType | rangeNotSatisfiable | expectationFailed | misdirectedRequest | unprocessableContent | upgradeRequired | internalServerError | notImplemented | badGateway | serviceUnavailable | gatewayTimeout | httpVersionNotSupported
continue | switchingProtocols | okay | created | accepted | nonAuthoritativeInformation | noContent | resetContent | partialContent | multipleChoices | movedPermanently | found | seeOther | notModified | useProxy | temporaryRedirect | permanentRedirect | badRequest | unauthorized | paymentRequired | forbidden | notFound | methodNotAllowed | notAcceptable | proxyAuthenticationRequired | requestTimeout | conflict | gone | lengthRequired | preconditionFailed | contentTooLarge | uriTooLong | unsupportedMediaType | rangeNotSatisfiable | expectationFailed | misdirectedRequest | unprocessableContent | upgradeRequired | internalServerError | notImplemented | badGateway | serviceUnavailable | gatewayTimeout | httpVersionNotSupported.
This is a shorter way of achieving similar verifications via “assert.responseCode”. If you need more control, then use “assert.responseCode” e.g.
Sourcepub fn response_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn response_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn response_code(self, value: String) -> TestScriptSetupActionAssertBuilder
pub fn response_code(self, value: String) -> TestScriptSetupActionAssertBuilder
HTTP response code to test
The value of the HTTP response code to be tested.
To be used with “operator” attribute value. Asserts that the response code equals this value if “operator” is not specified. If the operator is “in” or “notIn” then the responseCode would be a comma-separated list of values e.g. “200,201”. Otherwise, it’s expected to be a numeric value. If “fixture” is not specified, then the “responseBodyId” value of the last operation is assumed.
Sourcepub fn response_code_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn response_code_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn source_id(self, value: String) -> TestScriptSetupActionAssertBuilder
pub fn source_id(self, value: String) -> TestScriptSetupActionAssertBuilder
Fixture Id of source expression or headerField
Fixture to evaluate the XPath/JSONPath expression or the headerField against.
This can be a statically defined fixture (at the top of the testscript) or a dynamically set fixture created by responseId of the action.operation element.
Sourcepub fn source_id_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn source_id_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn stop_test_on_fail(
self,
value: bool,
) -> TestScriptSetupActionAssertBuilder
pub fn stop_test_on_fail( self, value: bool, ) -> TestScriptSetupActionAssertBuilder
If this assert fails, will the current test execution stop?
Whether or not the current test execution will stop on failure for this assert.
If this element is specified and it is true, then assertion failures should not stop the current test execution from proceeding.
Sourcepub fn stop_test_on_fail_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn stop_test_on_fail_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn validate_profile_id(
self,
value: String,
) -> TestScriptSetupActionAssertBuilder
pub fn validate_profile_id( self, value: String, ) -> TestScriptSetupActionAssertBuilder
Profile Id of validation profile reference
The ID of the Profile to validate against.
The ID of a Profile fixture. Asserts that the response is valid according to the Profile specified by validateProfileId.
Sourcepub fn validate_profile_id_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn validate_profile_id_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn value(self, value: String) -> TestScriptSetupActionAssertBuilder
pub fn value(self, value: String) -> TestScriptSetupActionAssertBuilder
The value to compare to
The value to compare to.
The string-representation of a number, string, or boolean that is expected. Test engines do have to look for placeholders (${}) and replace the variable placeholders with the variable values at runtime before comparing this value to the actual value.
Sourcepub fn value_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn value_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn warning_only(self, value: bool) -> TestScriptSetupActionAssertBuilder
pub fn warning_only(self, value: bool) -> TestScriptSetupActionAssertBuilder
Will this assert produce a warning only on error?
Whether or not the test execution will produce a warning only on error for this assert.
If this element is specified and it is true, then assertion failures can be logged by test engine but should not stop the test script execution from proceeding. There are likely cases where the spec is not clear on what should happen. If the spec says something is optional (maybe a response header for example), but a server doesn’t do it, we could choose to issue a warning.
Sourcepub fn warning_only_ext(
self,
value: FieldExtension,
) -> TestScriptSetupActionAssertBuilder
pub fn warning_only_ext( self, value: FieldExtension, ) -> TestScriptSetupActionAssertBuilder
Extension field.
Sourcepub fn requirement(
self,
value: Vec<Option<TestScriptSetupActionAssertRequirement>>,
) -> TestScriptSetupActionAssertBuilder
pub fn requirement( self, value: Vec<Option<TestScriptSetupActionAssertRequirement>>, ) -> TestScriptSetupActionAssertBuilder
Links or references to the testing requirements
Links or references providing traceability to the testing requirements for this assert.
TestScript and TestReport instances are typically (and expected to be) based on known, defined test requirements and documentation. These links provide traceability from the executable/executed TestScript and TestReport tests to these requirements.
Sourcepub fn requirement_ext(
self,
value: Vec<Option<FieldExtension>>,
) -> TestScriptSetupActionAssertBuilder
pub fn requirement_ext( self, value: Vec<Option<FieldExtension>>, ) -> TestScriptSetupActionAssertBuilder
Extension field.