davinci_crd_test_kit 0.14.1 → 0.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/config/presets/{inferno_crd_server_suite.json.erb → client_against_inferno_crd_server_suite.json.erb} +0 -33
  3. data/config/presets/{ri_crd_request_generator.json.erb → client_against_ri_crd_request_generator.json.erb} +1 -14
  4. data/config/presets/client_v221_against_inferno_crd_server_suite.json.erb +84 -0
  5. data/config/presets/client_v221_against_ri_br_provider.json.erb +31 -0
  6. data/config/presets/{ri_crd_request_generator.json_v221.json.erb → client_v221_against_ri_crd_request_generator.json.erb} +1 -1
  7. data/config/presets/{inferno_crd_client_suite.json.erb → server_against_inferno_crd_client_suite.json.erb} +0 -43
  8. data/config/presets/{ri_crd_server.json.erb → server_against_ri_crd_server.json.erb} +1 -44
  9. data/config/presets/{inferno_crd_client_suite_v221.json.erb → server_v221_against_inferno_crd_client_suite.json.erb} +0 -61
  10. data/config/presets/{inferno_crd_client_suite_prefetch_subset_v221.json.erb → server_v221_against_inferno_crd_client_suite_prefetch_subset.json.erb} +0 -46
  11. data/config/presets/server_v221_against_inferno_g31_suite.json.erb +49 -0
  12. data/lib/davinci_crd_test_kit/client/cross_hook_helper.rb +26 -0
  13. data/lib/davinci_crd_test_kit/client/endpoints/custom_service_response.rb +7 -7
  14. data/lib/davinci_crd_test_kit/client/endpoints/gather_response_generation_data.rb +4 -1
  15. data/lib/davinci_crd_test_kit/client/endpoints/hook_request_endpoint.rb +63 -38
  16. data/lib/davinci_crd_test_kit/client/endpoints/mock_service_response.rb +26 -7
  17. data/lib/davinci_crd_test_kit/client/endpoints/scenario_service_response.rb +54 -0
  18. data/lib/davinci_crd_test_kit/client/tagged_request_load_helper.rb +8 -27
  19. data/lib/davinci_crd_test_kit/client/v2.0.1/auth/retrieve_jwks_test.rb +35 -23
  20. data/lib/davinci_crd_test_kit/client/v2.0.1/auth/token_payload_test.rb +34 -21
  21. data/lib/davinci_crd_test_kit/client/v2.0.1/cds-services-v201.json +20 -20
  22. data/lib/davinci_crd_test_kit/client/v2.0.1/client_appointment_book_group.rb +12 -10
  23. data/lib/davinci_crd_test_kit/client/v2.0.1/client_encounter_discharge_group.rb +12 -10
  24. data/lib/davinci_crd_test_kit/client/v2.0.1/client_encounter_start_group.rb +12 -10
  25. data/lib/davinci_crd_test_kit/client/v2.0.1/client_hooks_group.rb +5 -5
  26. data/lib/davinci_crd_test_kit/client/v2.0.1/client_order_dispatch_group.rb +12 -10
  27. data/lib/davinci_crd_test_kit/client/v2.0.1/client_order_select_group.rb +12 -10
  28. data/lib/davinci_crd_test_kit/client/v2.0.1/client_order_sign_group.rb +12 -10
  29. data/lib/davinci_crd_test_kit/client/v2.0.1/must_support/client_card_must_support_coverage_information.rb +3 -36
  30. data/lib/davinci_crd_test_kit/client/v2.0.1/must_support/client_card_must_support_external_reference.rb +3 -36
  31. data/lib/davinci_crd_test_kit/client/v2.0.1/must_support/client_card_must_support_instructions.rb +3 -36
  32. data/lib/davinci_crd_test_kit/client/v2.0.1/verify_request/hook_request_fetched_data_test.rb +4 -13
  33. data/lib/davinci_crd_test_kit/client/v2.0.1/verify_request/hook_request_prefetch_equals_queried_test.rb +3 -13
  34. data/lib/davinci_crd_test_kit/client/v2.0.1/verify_response/client_display_cards_attest.rb +3 -13
  35. data/lib/davinci_crd_test_kit/client/v2.0.1/verify_response/inferno_response_validation.rb +3 -13
  36. data/lib/davinci_crd_test_kit/client/v2.2.1/api/client_coverage_info_update_test.rb +1 -1
  37. data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/attestation_instructions.rb +10 -0
  38. data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_authorized_scope_attestation_test.rb +45 -0
  39. data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_coverage_based_invocation_attestation_test.rb +44 -0
  40. data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_data_element_expectations_attestation_test.rb +44 -0
  41. data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_hook_invocation_logging_attestation_test.rb +43 -0
  42. data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_must_support_exposure_attestation_test.rb +43 -0
  43. data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_must_support_use_attestation_test.rb +41 -0
  44. data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_order_sign_support_attestation_test.rb +42 -0
  45. data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_prefetch_key_omission_attestation_test.rb +42 -0
  46. data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_resource_identifiers_attestation_test.rb +43 -0
  47. data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_response_case_distinction_attestation_test.rb +43 -0
  48. data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_security_and_privacy_attestation_test.rb +43 -0
  49. data/lib/davinci_crd_test_kit/client/v2.2.1/attestations/client_workflow_integration_attestation_test.rb +44 -0
  50. data/lib/davinci_crd_test_kit/client/v2.2.1/auth/decode_auth_token_test.rb +1 -1
  51. data/lib/davinci_crd_test_kit/client/v2.2.1/auth/retrieve_jwks_test.rb +29 -18
  52. data/lib/davinci_crd_test_kit/client/v2.2.1/auth/token_payload_test.rb +35 -22
  53. data/lib/davinci_crd_test_kit/client/v2.2.1/cds-services-prefetch-subset-v221.json +47 -47
  54. data/lib/davinci_crd_test_kit/client/v2.2.1/cds-services-v221.json +50 -50
  55. data/lib/davinci_crd_test_kit/client/v2.2.1/client_appointment_book_group.rb +16 -14
  56. data/lib/davinci_crd_test_kit/client/v2.2.1/client_attestations_group.rb +49 -0
  57. data/lib/davinci_crd_test_kit/client/v2.2.1/client_cross_hook_group.rb +22 -6
  58. data/lib/davinci_crd_test_kit/client/v2.2.1/client_cross_hook_interaction_group.rb +98 -0
  59. data/lib/davinci_crd_test_kit/client/v2.2.1/client_encounter_discharge_group.rb +12 -10
  60. data/lib/davinci_crd_test_kit/client/v2.2.1/client_encounter_start_group.rb +12 -10
  61. data/lib/davinci_crd_test_kit/client/v2.2.1/client_fhir_api_group.rb +14 -12
  62. data/lib/davinci_crd_test_kit/client/v2.2.1/client_hooks_group.rb +9 -9
  63. data/lib/davinci_crd_test_kit/client/v2.2.1/client_long_running_hook_group.rb +2 -1
  64. data/lib/davinci_crd_test_kit/client/v2.2.1/client_order_dispatch_group.rb +16 -14
  65. data/lib/davinci_crd_test_kit/client/v2.2.1/client_order_select_group.rb +12 -10
  66. data/lib/davinci_crd_test_kit/client/v2.2.1/client_order_sign_group.rb +16 -14
  67. data/lib/davinci_crd_test_kit/client/v2.2.1/client_scenarios_group.rb +26 -0
  68. data/lib/davinci_crd_test_kit/client/v2.2.1/client_self_pay_hook_group.rb +36 -0
  69. data/lib/davinci_crd_test_kit/client/v2.2.1/client_unknown_content_hook_group.rb +34 -0
  70. data/lib/davinci_crd_test_kit/client/v2.2.1/crd_client_suite.rb +19 -3
  71. data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_card_must_support_coverage_information_test.rb +1 -1
  72. data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_fhirpath_collection_as_comma_delimited_string_test.rb +4 -11
  73. data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_hook_instances_unique_test.rb +1 -9
  74. data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_location_address_propagation_test.rb +6 -2
  75. data/lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_prefetch_complete_and_subset_test.rb +3 -12
  76. data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/appointment_book_receive_request_test.rb +8 -89
  77. data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/base_hook_invocation_receive_request_test.rb +163 -0
  78. data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/cross_hooks_receive_request_test.rb +97 -0
  79. data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/encounter_discharge_receive_request_test.rb +8 -90
  80. data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/encounter_start_receive_request_test.rb +8 -90
  81. data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/order_dispatch_receive_request_test.rb +8 -98
  82. data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/order_select_receive_request_test.rb +8 -98
  83. data/lib/davinci_crd_test_kit/client/v2.2.1/invocation/order_sign_receive_request_test.rb +8 -98
  84. data/lib/davinci_crd_test_kit/client/v2.2.1/long_running/client_long_running_receive_request_test.rb +10 -2
  85. data/lib/davinci_crd_test_kit/client/v2.2.1/long_running/client_skip_long_running_attestation_test.rb +1 -1
  86. data/lib/davinci_crd_test_kit/client/v2.2.1/self_pay/client_self_pay_no_request_test.rb +30 -0
  87. data/lib/davinci_crd_test_kit/client/v2.2.1/self_pay/client_self_pay_workflow_test.rb +55 -0
  88. data/lib/davinci_crd_test_kit/client/v2.2.1/unknown_content/client_unknown_content_attestation_test.rb +99 -0
  89. data/lib/davinci_crd_test_kit/client/v2.2.1/unknown_content/client_unknown_content_receive_request_test.rb +62 -0
  90. data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_conformance_test.rb +1 -1
  91. data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_coverage_verification_test.rb +10 -2
  92. data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_data_fetch_verification_test.rb +1 -1
  93. data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_granted_scopes_test.rb +1 -1
  94. data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_prefetch_complete_test.rb +1 -1
  95. data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_prefetch_profiles_test.rb +1 -1
  96. data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_requested_version_test.rb +1 -1
  97. data/lib/davinci_crd_test_kit/client/v2.2.1/verify_request/hook_request_secured_transport_test.rb +1 -1
  98. data/lib/davinci_crd_test_kit/client/v2.2.1/verify_response/client_display_cards_attest.rb +52 -20
  99. data/lib/davinci_crd_test_kit/client/v2.2.1/verify_response/hook_response_support_coverage_information_test.rb +1 -1
  100. data/lib/davinci_crd_test_kit/client/v2.2.1/verify_response/inferno_response_validation.rb +6 -3
  101. data/lib/davinci_crd_test_kit/cross_suite/cards_identification.rb +9 -0
  102. data/lib/davinci_crd_test_kit/cross_suite/logical_models_override_helper.rb +30 -13
  103. data/lib/davinci_crd_test_kit/cross_suite/prefetch_profile_validation.rb +2 -0
  104. data/lib/davinci_crd_test_kit/cross_suite/requests_logical_model_validation.rb +26 -27
  105. data/lib/davinci_crd_test_kit/cross_suite/response_logical_model_validation.rb +48 -41
  106. data/lib/davinci_crd_test_kit/cross_suite/tags.rb +3 -0
  107. data/lib/davinci_crd_test_kit/requirements/cds-hooks_3.0.0-ballot_requirements.xlsx +0 -0
  108. data/lib/davinci_crd_test_kit/requirements/davinci_crd_test_kit_requirements.csv +6 -2
  109. data/lib/davinci_crd_test_kit/requirements/generated/crd_client_requirements_coverage.csv +107 -107
  110. data/lib/davinci_crd_test_kit/requirements/generated/crd_client_v221_requirements_coverage.csv +101 -97
  111. data/lib/davinci_crd_test_kit/requirements/generated/crd_server_requirements_coverage.csv +18 -18
  112. data/lib/davinci_crd_test_kit/requirements/generated/crd_server_v221_requirements_coverage.csv +36 -32
  113. data/lib/davinci_crd_test_kit/requirements/hl7.fhir.us.davinci-crd_2.2.1_requirements.xlsx +0 -0
  114. data/lib/davinci_crd_test_kit/server/v2.0.1/crd_server_suite.rb +1 -1
  115. data/lib/davinci_crd_test_kit/server/v2.0.1/server_hooks_group.rb +5 -5
  116. data/lib/davinci_crd_test_kit/server/v2.2.1/discovery/discovery_standard_prefetch_expressions_test.rb +1 -2
  117. data/lib/davinci_crd_test_kit/server/v2.2.1/server_demonstrate_hook_response_group.rb +2 -2
  118. data/lib/davinci_crd_test_kit/server/v2.2.1/server_hooks_group.rb +5 -5
  119. data/lib/davinci_crd_test_kit/version.rb +2 -2
  120. metadata +40 -12
  121. data/config/presets/inferno_crd_server_suite_v221.json.erb +0 -94
@@ -1,10 +1,8 @@
1
- require_relative '../client_urls'
1
+ require_relative 'base_hook_invocation_receive_request_test'
2
2
 
3
3
  module DaVinciCRDTestKit
4
4
  module V221
5
- class EncounterDischargeReceiveRequestTest < Inferno::Test
6
- include ClientURLs
7
-
5
+ class EncounterDischargeReceiveRequestTest < BaseHookInvocationReceiveRequestTest
8
6
  id :crd_v221_encounter_discharge_request
9
7
  title 'Client invokes the encounter-discharge hook'
10
8
  description %(
@@ -20,16 +18,6 @@ module DaVinciCRDTestKit
20
18
  5 minutes the test will become inactive and unresponsive to anything except cancelation).
21
19
  )
22
20
 
23
- config options: { accepts_multiple_requests: true }
24
-
25
- input :cds_jwt_iss,
26
- title: 'CRD JWT Issuer',
27
- description: %(
28
- Value of the `iss` claim that must be present in the JWT used to authorize the client's hook
29
- request sent as the Bearer token in the `Authorization` header.
30
- Run or re-run the "Registration" group to set or change this value.
31
- ),
32
- locked: true
33
21
  input :encounter_discharge_response_approach,
34
22
  title: 'Response generation approach for encounter-discharge',
35
23
  description: %(
@@ -61,34 +49,7 @@ module DaVinciCRDTestKit
61
49
  type: 'checkbox',
62
50
  default: ['coverage_information', 'external_reference', 'instructions'],
63
51
  optional: true,
64
- options: {
65
- list_options: [
66
- {
67
- label: 'External Reference',
68
- value: 'external_reference'
69
- },
70
- {
71
- label: 'Instructions',
72
- value: 'instructions'
73
- },
74
- {
75
- label: 'Coverage Information',
76
- value: 'coverage_information'
77
- },
78
- {
79
- label: 'Request Form Completion',
80
- value: 'request_form_completion'
81
- },
82
- {
83
- label: 'Create/Update Coverage Information',
84
- value: 'create_update_coverage_info'
85
- },
86
- {
87
- label: 'Launch SMART Application',
88
- value: 'launch_smart_app'
89
- }
90
- ]
91
- },
52
+ options: { list_options: RESPONSE_TYPE_OPTIONS },
92
53
  enable_when: { input_name: 'encounter_discharge_response_approach', value: 'mocked' }
93
54
  input :encounter_discharge_custom_response_template,
94
55
  title: 'Custom response template for encounter-discharge hook requests',
@@ -99,58 +60,15 @@ module DaVinciCRDTestKit
99
60
  type: 'textarea',
100
61
  optional: true,
101
62
  enable_when: { input_name: 'encounter_discharge_response_approach', value: 'custom' }
102
- output :continuation_url
103
-
104
- def configured_response_details
105
- if encounter_discharge_response_approach == 'custom'
106
- # rubocop:disable Layout/LineLength
107
- 'When responding, Inferno will evaluate the provided [custom response template](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Controlling-Simulated-Responses#tester-directed-custom-responses) ' \
108
- 'from the **Custom response template for encounter-discharge hook requests** input ' \
109
- 'against the incoming request to create a response.'
110
- # rubocop:enable Layout/LineLength
111
63
 
112
- else
113
- # rubocop:disable Layout/LineLength
114
- 'When responding, Inferno will [mock](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Controlling-Simulated-Responses#mocked-responses) ' \
115
- 'the following response types using the incoming request: ' \
116
- "\n - #{selected_response_types_string}"
117
- # rubocop:enable Layout/LineLength
118
- end
119
- end
64
+ private
120
65
 
121
- def selected_response_types_string
122
- if encounter_discharge_selected_response_types.present?
123
- encounter_discharge_selected_response_types.join("\n - ")
124
- else
125
- 'Instructions' # secondary hook default
126
- end
66
+ def hook_key
67
+ 'encounter_discharge'
127
68
  end
128
69
 
129
- run do
130
- identifier = cds_jwt_iss
131
- continuation_url = "#{resume_pass_url}?token=#{identifier}"
132
- output(continuation_url:)
133
-
134
- wait(
135
- identifier:,
136
- message: %(
137
- **Invoke the `encounter-discharge` hook**:
138
-
139
- Invoke the encounter-discharge hook by sending requests to
140
- one or both of the two Inferno simulated CRD servers:
141
-
142
- - Complete Prefetch: `#{encounter_discharge_url}`
143
- - Subset Prefetch: `#{encounter_discharge_prefetch_subset_url}`
144
-
145
- For Inferno to recognize these requests and associate them with this session,
146
- the authentication JWT sent as a Bearer token in the Authorization header
147
- must have `#{cds_jwt_iss}` as the `iss` claim in the JWT payload.
148
-
149
- #{configured_response_details}
150
-
151
- [Click here](#{continuation_url}) when you have finished submitting requests.
152
- )
153
- )
70
+ def primary_hook?
71
+ false
154
72
  end
155
73
  end
156
74
  end
@@ -1,10 +1,8 @@
1
- require_relative '../client_urls'
1
+ require_relative 'base_hook_invocation_receive_request_test'
2
2
 
3
3
  module DaVinciCRDTestKit
4
4
  module V221
5
- class EncounterStartReceiveRequestTest < Inferno::Test
6
- include ClientURLs
7
-
5
+ class EncounterStartReceiveRequestTest < BaseHookInvocationReceiveRequestTest
8
6
  id :crd_v221_encounter_start_request
9
7
  title 'Client invokes the encounter-start hook'
10
8
  description %(
@@ -20,16 +18,6 @@ module DaVinciCRDTestKit
20
18
  5 minutes the test will become inactive and unresponsive to anything except cancelation).
21
19
  )
22
20
 
23
- config options: { accepts_multiple_requests: true }
24
-
25
- input :cds_jwt_iss,
26
- title: 'CRD JWT Issuer',
27
- description: %(
28
- Value of the `iss` claim that must be present in the JWT used to authorize the client's hook
29
- request sent as the Bearer token in the `Authorization` header.
30
- Run or re-run the "Registration" group to set or change this value.
31
- ),
32
- locked: true
33
21
  input :encounter_start_response_approach,
34
22
  title: 'Response generation approach for encounter-start',
35
23
  description: %(
@@ -61,34 +49,7 @@ module DaVinciCRDTestKit
61
49
  type: 'checkbox',
62
50
  default: ['coverage_information', 'external_reference', 'instructions'],
63
51
  optional: true,
64
- options: {
65
- list_options: [
66
- {
67
- label: 'External Reference',
68
- value: 'external_reference'
69
- },
70
- {
71
- label: 'Instructions',
72
- value: 'instructions'
73
- },
74
- {
75
- label: 'Coverage Information',
76
- value: 'coverage_information'
77
- },
78
- {
79
- label: 'Request Form Completion',
80
- value: 'request_form_completion'
81
- },
82
- {
83
- label: 'Create/Update Coverage Information',
84
- value: 'create_update_coverage_info'
85
- },
86
- {
87
- label: 'Launch SMART Application',
88
- value: 'launch_smart_app'
89
- }
90
- ]
91
- },
52
+ options: { list_options: RESPONSE_TYPE_OPTIONS },
92
53
  enable_when: { input_name: 'encounter_start_response_approach', value: 'mocked' }
93
54
  input :encounter_start_custom_response_template,
94
55
  title: 'Custom response template for encounter-start hook requests',
@@ -99,58 +60,15 @@ module DaVinciCRDTestKit
99
60
  type: 'textarea',
100
61
  optional: true,
101
62
  enable_when: { input_name: 'encounter_start_response_approach', value: 'custom' }
102
- output :continuation_url
103
-
104
- def configured_response_details
105
- if encounter_start_response_approach == 'custom'
106
- # rubocop:disable Layout/LineLength
107
- 'When responding, Inferno will evaluate the provided [custom response template](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Controlling-Simulated-Responses#tester-directed-custom-responses) ' \
108
- 'from the **Custom response template for encounter-start hook requests** input ' \
109
- 'against the incoming request to create a response.'
110
- # rubocop:enable Layout/LineLength
111
63
 
112
- else
113
- # rubocop:disable Layout/LineLength
114
- 'When responding, Inferno will [mock](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Controlling-Simulated-Responses#mocked-responses) ' \
115
- 'the following response types using the incoming request: ' \
116
- "\n - #{selected_response_types_string}"
117
- # rubocop:enable Layout/LineLength
118
- end
119
- end
64
+ private
120
65
 
121
- def selected_response_types_string
122
- if encounter_start_selected_response_types.present?
123
- encounter_start_selected_response_types.join("\n - ")
124
- else
125
- 'Instructions' # secondary hook default
126
- end
66
+ def hook_key
67
+ 'encounter_start'
127
68
  end
128
69
 
129
- run do
130
- identifier = cds_jwt_iss
131
- continuation_url = "#{resume_pass_url}?token=#{identifier}"
132
- output(continuation_url:)
133
-
134
- wait(
135
- identifier:,
136
- message: %(
137
- **Invoke the `encounter-start` hook**:
138
-
139
- Invoke the encounter-start hook by sending requests to
140
- one or both of the two Inferno simulated CRD servers:
141
-
142
- - Complete Prefetch: `#{encounter_start_url}`
143
- - Subset Prefetch: `#{encounter_start_prefetch_subset_url}`
144
-
145
- For Inferno to recognize these requests and associate them with this session,
146
- the authentication JWT sent as a Bearer token in the Authorization header
147
- must have `#{cds_jwt_iss}` as the `iss` claim in the JWT payload.
148
-
149
- #{configured_response_details}
150
-
151
- [Click here](#{continuation_url}) when you have finished submitting requests.
152
- )
153
- )
70
+ def primary_hook?
71
+ false
154
72
  end
155
73
  end
156
74
  end
@@ -1,10 +1,8 @@
1
- require_relative '../client_urls'
1
+ require_relative 'base_hook_invocation_receive_request_test'
2
2
 
3
3
  module DaVinciCRDTestKit
4
4
  module V221
5
- class OrderDispatchReceiveRequestTest < Inferno::Test
6
- include ClientURLs
7
-
5
+ class OrderDispatchReceiveRequestTest < BaseHookInvocationReceiveRequestTest
8
6
  id :crd_v221_order_dispatch_request
9
7
  title 'Client invokes the order-dispatch hook'
10
8
  description %(
@@ -20,16 +18,6 @@ module DaVinciCRDTestKit
20
18
  5 minutes the test will become inactive and unresponsive to anything except cancelation).
21
19
  )
22
20
 
23
- config options: { accepts_multiple_requests: true }
24
-
25
- input :cds_jwt_iss,
26
- title: 'CRD JWT Issuer',
27
- description: %(
28
- Value of the `iss` claim that must be present in the JWT used to authorize the client's hook
29
- request sent as the Bearer token in the `Authorization` header.
30
- Run or re-run the "Registration" group to set or change this value.
31
- ),
32
- locked: true
33
21
  input :order_dispatch_response_approach,
34
22
  title: 'Response generation approach for order-dispatch',
35
23
  description: %(
@@ -61,42 +49,7 @@ module DaVinciCRDTestKit
61
49
  type: 'checkbox',
62
50
  default: ['coverage_information', 'external_reference', 'instructions'],
63
51
  optional: true,
64
- options: {
65
- list_options: [
66
- {
67
- label: 'External Reference',
68
- value: 'external_reference'
69
- },
70
- {
71
- label: 'Instructions',
72
- value: 'instructions'
73
- },
74
- {
75
- label: 'Coverage Information',
76
- value: 'coverage_information'
77
- },
78
- {
79
- label: 'Request Form Completion',
80
- value: 'request_form_completion'
81
- },
82
- {
83
- label: 'Create/Update Coverage Information',
84
- value: 'create_update_coverage_info'
85
- },
86
- {
87
- label: 'Launch SMART Application',
88
- value: 'launch_smart_app'
89
- },
90
- {
91
- label: 'Propose Alternate Request',
92
- value: 'propose_alternate_request'
93
- },
94
- {
95
- label: 'Additional Orders as Companions/Prerequisites',
96
- value: 'companions_prerequisites'
97
- }
98
- ]
99
- },
52
+ options: { list_options: ORDER_RESPONSE_TYPE_OPTIONS },
100
53
  enable_when: { input_name: 'order_dispatch_response_approach', value: 'mocked' }
101
54
  input :order_dispatch_custom_response_template,
102
55
  title: 'Custom response template for order-dispatch hook requests',
@@ -107,58 +60,15 @@ module DaVinciCRDTestKit
107
60
  type: 'textarea',
108
61
  optional: true,
109
62
  enable_when: { input_name: 'order_dispatch_response_approach', value: 'custom' }
110
- output :continuation_url
111
63
 
112
- def configured_response_details
113
- if order_dispatch_response_approach == 'custom'
114
- # rubocop:disable Layout/LineLength
115
- 'When responding, Inferno will evaluate the provided [custom response template](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Controlling-Simulated-Responses#tester-directed-custom-responses) ' \
116
- 'from the **Custom response template for order-dispatch hook requests** input ' \
117
- 'against the incoming request to create a response.'
118
- # rubocop:enable Layout/LineLength
64
+ private
119
65
 
120
- else
121
- # rubocop:disable Layout/LineLength
122
- 'When responding, Inferno will [mock](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Controlling-Simulated-Responses#mocked-responses) ' \
123
- 'the following response types using the incoming request: ' \
124
- "\n - #{selected_response_types_string}"
125
- # rubocop:enable Layout/LineLength
126
- end
66
+ def hook_key
67
+ 'order_dispatch'
127
68
  end
128
69
 
129
- def selected_response_types_string
130
- if order_dispatch_selected_response_types.present?
131
- order_dispatch_selected_response_types.join("\n - ")
132
- else
133
- 'Coverage Information' # primary hook default
134
- end
135
- end
136
-
137
- run do
138
- identifier = cds_jwt_iss
139
- continuation_url = "#{resume_pass_url}?token=#{identifier}"
140
- output(continuation_url:)
141
-
142
- wait(
143
- identifier:,
144
- message: %(
145
- **Invoke the `order-dispatch` hook**:
146
-
147
- Invoke the order-dispatch hook by sending requests to
148
- one or both of the two Inferno simulated CRD servers:
149
-
150
- - Complete Prefetch: `#{order_dispatch_url}`
151
- - Subset Prefetch: `#{order_dispatch_prefetch_subset_url}`
152
-
153
- For Inferno to recognize these requests and associate them with this session,
154
- the authentication JWT sent as a Bearer token in the Authorization header
155
- must have `#{cds_jwt_iss}` as the `iss` claim in the JWT payload.
156
-
157
- #{configured_response_details}
158
-
159
- [Click here](#{continuation_url}) when you have finished submitting requests.
160
- )
161
- )
70
+ def primary_hook?
71
+ true
162
72
  end
163
73
  end
164
74
  end
@@ -1,10 +1,8 @@
1
- require_relative '../client_urls'
1
+ require_relative 'base_hook_invocation_receive_request_test'
2
2
 
3
3
  module DaVinciCRDTestKit
4
4
  module V221
5
- class OrderSelectReceiveRequestTest < Inferno::Test
6
- include ClientURLs
7
-
5
+ class OrderSelectReceiveRequestTest < BaseHookInvocationReceiveRequestTest
8
6
  id :crd_v221_order_select_request
9
7
  title 'Client invokes the order-select hook'
10
8
  description %(
@@ -20,16 +18,6 @@ module DaVinciCRDTestKit
20
18
  5 minutes the test will become inactive and unresponsive to anything except cancelation).
21
19
  )
22
20
 
23
- config options: { accepts_multiple_requests: true }
24
-
25
- input :cds_jwt_iss,
26
- title: 'CRD JWT Issuer',
27
- description: %(
28
- Value of the `iss` claim that must be present in the JWT used to authorize the client's hook
29
- request sent as the Bearer token in the `Authorization` header.
30
- Run or re-run the "Registration" group to set or change this value.
31
- ),
32
- locked: true
33
21
  input :order_select_response_approach,
34
22
  title: 'Response generation approach for order-select',
35
23
  description: %(
@@ -61,42 +49,7 @@ module DaVinciCRDTestKit
61
49
  type: 'checkbox',
62
50
  default: ['coverage_information', 'external_reference', 'instructions'],
63
51
  optional: true,
64
- options: {
65
- list_options: [
66
- {
67
- label: 'External Reference',
68
- value: 'external_reference'
69
- },
70
- {
71
- label: 'Instructions',
72
- value: 'instructions'
73
- },
74
- {
75
- label: 'Coverage Information',
76
- value: 'coverage_information'
77
- },
78
- {
79
- label: 'Request Form Completion',
80
- value: 'request_form_completion'
81
- },
82
- {
83
- label: 'Create/Update Coverage Information',
84
- value: 'create_update_coverage_info'
85
- },
86
- {
87
- label: 'Launch SMART Application',
88
- value: 'launch_smart_app'
89
- },
90
- {
91
- label: 'Propose Alternate Request',
92
- value: 'propose_alternate_request'
93
- },
94
- {
95
- label: 'Additional Orders as Companions/Prerequisites',
96
- value: 'companions_prerequisites'
97
- }
98
- ]
99
- },
52
+ options: { list_options: ORDER_RESPONSE_TYPE_OPTIONS },
100
53
  enable_when: { input_name: 'order_select_response_approach', value: 'mocked' }
101
54
  input :order_select_custom_response_template,
102
55
  title: 'Custom response template for order-select hook requests',
@@ -107,58 +60,15 @@ module DaVinciCRDTestKit
107
60
  type: 'textarea',
108
61
  optional: true,
109
62
  enable_when: { input_name: 'order_select_response_approach', value: 'custom' }
110
- output :continuation_url
111
63
 
112
- def configured_response_details
113
- if order_select_response_approach == 'custom'
114
- # rubocop:disable Layout/LineLength
115
- 'When responding, Inferno will evaluate the provided [custom response template](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Controlling-Simulated-Responses#tester-directed-custom-responses) ' \
116
- 'from the **Custom response template for order-select hook requests** input ' \
117
- 'against the incoming request to create a response.'
118
- # rubocop:enable Layout/LineLength
64
+ private
119
65
 
120
- else
121
- # rubocop:disable Layout/LineLength
122
- 'When responding, Inferno will [mock](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Controlling-Simulated-Responses#mocked-responses) ' \
123
- 'the following response types using the incoming request: ' \
124
- "\n - #{selected_response_types_string}"
125
- # rubocop:enable Layout/LineLength
126
- end
66
+ def hook_key
67
+ 'order_select'
127
68
  end
128
69
 
129
- def selected_response_types_string
130
- if order_select_selected_response_types.present?
131
- order_select_selected_response_types.join("\n - ")
132
- else
133
- 'Instructions' # secondary hook default
134
- end
135
- end
136
-
137
- run do
138
- identifier = cds_jwt_iss
139
- continuation_url = "#{resume_pass_url}?token=#{identifier}"
140
- output(continuation_url:)
141
-
142
- wait(
143
- identifier:,
144
- message: %(
145
- **Invoke the `order-select` hook**:
146
-
147
- Invoke the order-select hook by sending requests to
148
- one or both of the two Inferno simulated CRD servers:
149
-
150
- - Complete Prefetch: `#{order_select_url}`
151
- - Subset Prefetch: `#{order_select_prefetch_subset_url}`
152
-
153
- For Inferno to recognize these requests and associate them with this session,
154
- the authentication JWT sent as a Bearer token in the Authorization header
155
- must have `#{cds_jwt_iss}` as the `iss` claim in the JWT payload.
156
-
157
- #{configured_response_details}
158
-
159
- [Click here](#{continuation_url}) when you have finished submitting requests.
160
- )
161
- )
70
+ def primary_hook?
71
+ false
162
72
  end
163
73
  end
164
74
  end
@@ -1,10 +1,8 @@
1
- require_relative '../client_urls'
1
+ require_relative 'base_hook_invocation_receive_request_test'
2
2
 
3
3
  module DaVinciCRDTestKit
4
4
  module V221
5
- class OrderSignReceiveRequestTest < Inferno::Test
6
- include ClientURLs
7
-
5
+ class OrderSignReceiveRequestTest < BaseHookInvocationReceiveRequestTest
8
6
  id :crd_v221_order_sign_request
9
7
  title 'Client invokes the order-sign hook'
10
8
  description %(
@@ -20,16 +18,6 @@ module DaVinciCRDTestKit
20
18
  5 minutes the test will become inactive and unresponsive to anything except cancelation).
21
19
  )
22
20
 
23
- config options: { accepts_multiple_requests: true }
24
-
25
- input :cds_jwt_iss,
26
- title: 'CRD JWT Issuer',
27
- description: %(
28
- Value of the `iss` claim that must be present in the JWT used to authorize the client's hook
29
- request sent as the Bearer token in the `Authorization` header.
30
- Run or re-run the "Registration" group to set or change this value.
31
- ),
32
- locked: true
33
21
  input :order_sign_response_approach,
34
22
  title: 'Response generation approach for order-sign',
35
23
  description: %(
@@ -61,42 +49,7 @@ module DaVinciCRDTestKit
61
49
  type: 'checkbox',
62
50
  default: ['coverage_information', 'external_reference', 'instructions'],
63
51
  optional: true,
64
- options: {
65
- list_options: [
66
- {
67
- label: 'External Reference',
68
- value: 'external_reference'
69
- },
70
- {
71
- label: 'Instructions',
72
- value: 'instructions'
73
- },
74
- {
75
- label: 'Coverage Information',
76
- value: 'coverage_information'
77
- },
78
- {
79
- label: 'Request Form Completion',
80
- value: 'request_form_completion'
81
- },
82
- {
83
- label: 'Create/Update Coverage Information',
84
- value: 'create_update_coverage_info'
85
- },
86
- {
87
- label: 'Launch SMART Application',
88
- value: 'launch_smart_app'
89
- },
90
- {
91
- label: 'Propose Alternate Request',
92
- value: 'propose_alternate_request'
93
- },
94
- {
95
- label: 'Additional Orders as Companions/Prerequisites',
96
- value: 'companions_prerequisites'
97
- }
98
- ]
99
- },
52
+ options: { list_options: ORDER_RESPONSE_TYPE_OPTIONS },
100
53
  enable_when: { input_name: 'order_sign_response_approach', value: 'mocked' }
101
54
  input :order_sign_custom_response_template,
102
55
  title: 'Custom response template for order-sign hook requests',
@@ -107,58 +60,15 @@ module DaVinciCRDTestKit
107
60
  type: 'textarea',
108
61
  optional: true,
109
62
  enable_when: { input_name: 'order_sign_response_approach', value: 'custom' }
110
- output :continuation_url
111
63
 
112
- def configured_response_details
113
- if order_sign_response_approach == 'custom'
114
- # rubocop:disable Layout/LineLength
115
- 'When responding, Inferno will evaluate the provided [custom response template](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Controlling-Simulated-Responses#tester-directed-custom-responses) ' \
116
- 'from the **Custom response template for order-sign hook requests** input ' \
117
- 'against the incoming request to create a response.'
118
- # rubocop:enable Layout/LineLength
64
+ private
119
65
 
120
- else
121
- # rubocop:disable Layout/LineLength
122
- 'When responding, Inferno will [mock](https://github.com/inferno-framework/davinci-crd-test-kit/wiki/Controlling-Simulated-Responses#mocked-responses) ' \
123
- 'the following response types using the incoming request: ' \
124
- "\n - #{selected_response_types_string}"
125
- # rubocop:enable Layout/LineLength
126
- end
66
+ def hook_key
67
+ 'order_sign'
127
68
  end
128
69
 
129
- def selected_response_types_string
130
- if order_sign_selected_response_types.present?
131
- order_sign_selected_response_types.join("\n - ")
132
- else
133
- 'Coverage Information' # primary hook default
134
- end
135
- end
136
-
137
- run do
138
- identifier = cds_jwt_iss
139
- continuation_url = "#{resume_pass_url}?token=#{identifier}"
140
- output(continuation_url:)
141
-
142
- wait(
143
- identifier:,
144
- message: %(
145
- **Invoke the `order-sign` hook**:
146
-
147
- Invoke the order-sign hook by sending requests to
148
- one or both of the two Inferno simulated CRD servers:
149
-
150
- - Complete Prefetch: `#{order_sign_url}`
151
- - Subset Prefetch: `#{order_sign_prefetch_subset_url}`
152
-
153
- For Inferno to recognize these requests and associate them with this session,
154
- the authentication JWT sent as a Bearer token in the Authorization header
155
- must have `#{cds_jwt_iss}` as the `iss` claim in the JWT payload.
156
-
157
- #{configured_response_details}
158
-
159
- [Click here](#{continuation_url}) when you have finished submitting requests.
160
- )
161
- )
70
+ def primary_hook?
71
+ true
162
72
  end
163
73
  end
164
74
  end