subscriptions_test_kit 0.9.2 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/inferno_requirements_tools/tasks/collect_requirements.rb +51 -50
- data/lib/inferno_requirements_tools/tasks/requirements_coverage.rb +22 -19
- data/lib/subscriptions_test_kit/common/notification_conformance_verification.rb +11 -12
- data/lib/subscriptions_test_kit/common/subscription_conformance_verification.rb +14 -2
- data/lib/subscriptions_test_kit/docs/samples/Subscription_empty.json +1 -1
- data/lib/subscriptions_test_kit/docs/samples/Subscription_full-resource.json +1 -1
- data/lib/subscriptions_test_kit/docs/samples/Subscription_id-only.json +1 -1
- data/lib/subscriptions_test_kit/docs/subscriptions_r5_backport_r4_client_suite_description.md +4 -1
- data/lib/subscriptions_test_kit/docs/subscriptions_r5_backport_r4_server_suite_description.md +4 -1
- data/lib/subscriptions_test_kit/endpoints/subscription_create_endpoint.rb +7 -3
- data/lib/subscriptions_test_kit/endpoints/subscription_status_endpoint.rb +19 -13
- data/lib/subscriptions_test_kit/jobs/send_subscription_notifications.rb +7 -2
- data/lib/subscriptions_test_kit/requirements/generated/subscriptions-test-kit_requirements_coverage.csv +51 -51
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/common/subscription_simulation_utils.rb +47 -16
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification/notification_input_payload_verification_test.rb +15 -8
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification/notification_input_verification_test.rb +8 -5
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification/processing_attestation_test.rb +1 -1
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification/subscription_verification_test.rb +3 -2
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification_group.rb +1 -1
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/interaction_test.rb +15 -11
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/interaction_verification/event_notification_verification_test.rb +6 -5
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/interaction_verification/handshake_notification_verification_test.rb +5 -5
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/interaction_verification_group.rb +1 -1
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client_suite.rb +5 -3
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/capability_statement/cs_conformance_test.rb +1 -1
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/capability_statement/topic_discovery_test.rb +3 -3
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/capability_statement_group.rb +3 -3
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/interaction/creation_response_conformance_test.rb +1 -1
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/interaction/subscription_conformance_test.rb +11 -14
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/interaction_group.rb +3 -3
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/subscription_creation.rb +10 -1
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/subscription_status_operation.rb +3 -2
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/event_notification/empty_content_group.rb +3 -2
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/event_notification/full_resource_content/full_resource_conformance_test.rb +3 -4
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/event_notification/full_resource_content_group.rb +3 -2
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/event_notification/id_only_content/id_only_conformance_test.rb +3 -4
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/event_notification/id_only_content_group.rb +3 -2
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/event_notification_group.rb +2 -2
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/handshake_heartbeat/handshake_conformance_test.rb +7 -6
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/handshake_heartbeat/heartbeat_conformance_test.rb +4 -2
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/status_operation/status_invocation_test.rb +2 -2
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/status_operation_group.rb +1 -1
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_channel_endpoint_test.rb +65 -0
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_channel_payload_combo_test.rb +76 -0
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_channel_type_test.rb +68 -0
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_cross_version_extension_test.rb +59 -0
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_filter_test.rb +66 -0
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_payload_type_test.rb +66 -0
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_topic_test.rb +64 -0
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection_group.rb +14 -2
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server_suite.rb +3 -2
- data/lib/subscriptions_test_kit/version.rb +1 -3
- metadata +11 -75
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscriptions_test.rb +0 -181
@@ -1,181 +0,0 @@
|
|
1
|
-
require_relative '../common/subscription_creation'
|
2
|
-
|
3
|
-
module SubscriptionsTestKit
|
4
|
-
module SubscriptionsR5BackportR4Server
|
5
|
-
class RejectSubscriptionsTest < Inferno::Test
|
6
|
-
include SubscriptionCreation
|
7
|
-
|
8
|
-
id :subscriptions_r4_server_reject_subscriptions
|
9
|
-
title 'Server Handles Unsupported Subscriptions'
|
10
|
-
description %(
|
11
|
-
When processing a request for a Subscription a server SHOULD verify that the Subscription is supported and does not
|
12
|
-
contain any information not implemented by the server. If the Subscription is no supported, the server should reject
|
13
|
-
the Subscription create request, or it should attempt to adjust the Subscription. This test checks that the server
|
14
|
-
correctly rejects or adjusts the Subscription in the following cases:
|
15
|
-
|
16
|
-
- The Subscription contains cross-version extension
|
17
|
-
- The Subscription contains a Subscription Topic not implemented by the server
|
18
|
-
- The Subscription contains a filtering criteria not implemented by the server
|
19
|
-
- The Subscription contains channel type not implemented by the server
|
20
|
-
- The Subscription contains an unsupported channel endpoint
|
21
|
-
- The Subscription contains a payload type not implemented by the server
|
22
|
-
- The Subscription contains an unsupported channel and payload type combination
|
23
|
-
|
24
|
-
The test will pass if the server either
|
25
|
-
1. rejects the Subscription by responding with a non-201 response, or
|
26
|
-
2. updates the Subscription resource to remove or replace the unsupported value.
|
27
|
-
)
|
28
|
-
|
29
|
-
verifies_requirements 'hl7.fhir.uv.subscriptions_1.1.0@8',
|
30
|
-
'hl7.fhir.uv.subscriptions_1.1.0@9',
|
31
|
-
'hl7.fhir.uv.subscriptions_1.1.0@10',
|
32
|
-
'hl7.fhir.uv.subscriptions_1.1.0@11',
|
33
|
-
'hl7.fhir.uv.subscriptions_1.1.0@12',
|
34
|
-
'hl7.fhir.uv.subscriptions_1.1.0@13'
|
35
|
-
|
36
|
-
input :subscription_resource,
|
37
|
-
title: 'Workflow Subscription Resource',
|
38
|
-
type: 'textarea',
|
39
|
-
description: %(
|
40
|
-
A Subscription resource in JSON format that Inferno will send to the server under test
|
41
|
-
so that it can demonstrate its ability to perform the Subscription creation and Notification
|
42
|
-
response workflow. The instance must be conformant to the R4/B Topic-Based Subscription profile.
|
43
|
-
Inferno may modify the Subscription before submission, e.g., to point to Inferno's notification endpoint.
|
44
|
-
This input is also used by the unsupported Subscription test as the base on which to add unsupported element
|
45
|
-
values to test for server rejection.
|
46
|
-
)
|
47
|
-
input :unsupported_subscription_topic,
|
48
|
-
title: 'Unsupported Subscription Topic',
|
49
|
-
description: 'A Subscription Topic for the `criteria` element that is not implemented by the server to test for Subscription rejection.',
|
50
|
-
optional: true
|
51
|
-
input :unsupported_subscription_filter,
|
52
|
-
title: 'Unsupported Subscription Filter',
|
53
|
-
description: 'A value for `filterCriteria` extension under the `criteria` that is not implemented by the server to test for Subscription rejection.',
|
54
|
-
optional: true
|
55
|
-
input :unsupported_subscription_channel_type,
|
56
|
-
title: 'Unsupported Subscription Channel Type',
|
57
|
-
description: 'A value for the `channel.type` element that is not implemented by the server to test for Subscription rejection.',
|
58
|
-
optional: true
|
59
|
-
input :unsupported_subscription_channel_endpoint,
|
60
|
-
title: 'Unsupported Subscription Channel Endpoint',
|
61
|
-
description: 'An unsupported value for the `channel.endpoint` element to test for Subscription rejection.',
|
62
|
-
optional: true
|
63
|
-
input :unsupported_subscription_payload_type,
|
64
|
-
title: 'Unsupported Subscription Payload Type',
|
65
|
-
description: 'A value for the `content` extension under the `channel.payload` element that is not implemented by the server to test for Subscription rejection.',
|
66
|
-
optional: true
|
67
|
-
input :unsupported_subscription_channel_payload_combo,
|
68
|
-
title: 'Unsupported Subscription Channel and Payload Combination',
|
69
|
-
description: %(
|
70
|
-
A channel (`channel.type`) and payload type (`content` extension under the `channel.payload` element)
|
71
|
-
combination not implemented by the server to test for Subscription
|
72
|
-
rejection. Provide in the json format e.g. {channel: <'channel_type'>, payload: <'payload_type'>}.
|
73
|
-
),
|
74
|
-
optional: true
|
75
|
-
|
76
|
-
def unsupported_subscriptions
|
77
|
-
[
|
78
|
-
{
|
79
|
-
'unsupported_title' => 'cross-version extensions',
|
80
|
-
'field_path' => ['_criteria'],
|
81
|
-
'field_value' => { 'extension' => [{
|
82
|
-
url: 'http://hl7.org/fhir/5.0/subscriptions-backport/StructureDefinition/backport-filter-criteria',
|
83
|
-
valueString: 'Encounter?patient=Patient/123'
|
84
|
-
}] }
|
85
|
-
},
|
86
|
-
{
|
87
|
-
'unsupported_title' => 'unsupported `SubscriptionTopic`',
|
88
|
-
'field_path' => ['criteria'],
|
89
|
-
'field_value' => unsupported_subscription_topic
|
90
|
-
},
|
91
|
-
{
|
92
|
-
'unsupported_title' => 'unsupported filter criteria',
|
93
|
-
'field_path' => ['_criteria'],
|
94
|
-
'field_value' => if unsupported_subscription_filter.nil?
|
95
|
-
unsupported_subscription_filter
|
96
|
-
else
|
97
|
-
{ 'extension' => [{
|
98
|
-
url: 'http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-filter-criteria',
|
99
|
-
valueString: unsupported_subscription_filter
|
100
|
-
}] }
|
101
|
-
end
|
102
|
-
},
|
103
|
-
{
|
104
|
-
'unsupported_title' => 'unsupported channel type',
|
105
|
-
'field_path' => ['channel', 'type'],
|
106
|
-
'field_value' => unsupported_subscription_channel_type
|
107
|
-
},
|
108
|
-
{
|
109
|
-
'unsupported_title' => 'unsupported channel URL',
|
110
|
-
'field_path' => ['channel', 'endpoint'],
|
111
|
-
'field_value' => unsupported_subscription_channel_endpoint
|
112
|
-
},
|
113
|
-
{
|
114
|
-
'unsupported_title' => 'unsupported channel type',
|
115
|
-
'field_path' => ['channel', 'type'],
|
116
|
-
'field_value' => unsupported_subscription_channel_type
|
117
|
-
},
|
118
|
-
{
|
119
|
-
'unsupported_title' => 'unsupported payload type',
|
120
|
-
'field_path' => ['channel', 'payload'],
|
121
|
-
'field_value' => unsupported_subscription_payload_type
|
122
|
-
}
|
123
|
-
]
|
124
|
-
end
|
125
|
-
|
126
|
-
run do
|
127
|
-
assert_valid_json(subscription_resource)
|
128
|
-
subscription = JSON.parse(subscription_resource)
|
129
|
-
|
130
|
-
unsupported_subscriptions.each do |unsupported_info|
|
131
|
-
next if unsupported_info['field_value'].blank?
|
132
|
-
|
133
|
-
field_name = unsupported_info['field_path'].last
|
134
|
-
|
135
|
-
if unsupported_info['field_path'].length > 1
|
136
|
-
outer_field_name = unsupported_info['field_path'].first
|
137
|
-
subscription_field = subscription[outer_field_name]
|
138
|
-
else
|
139
|
-
subscription_field = subscription
|
140
|
-
end
|
141
|
-
|
142
|
-
original_field_value = subscription_field[field_name]
|
143
|
-
subscription_field[field_name] = unsupported_info['field_value']
|
144
|
-
|
145
|
-
send_unsupported_subscription(subscription, unsupported_info['unsupported_title'], [unsupported_info['field_path']],
|
146
|
-
[unsupported_info['field_value']])
|
147
|
-
|
148
|
-
if original_field_value.nil?
|
149
|
-
subscription_field.delete(field_name)
|
150
|
-
else
|
151
|
-
subscription_field[field_name] = original_field_value
|
152
|
-
end
|
153
|
-
end
|
154
|
-
|
155
|
-
if unsupported_subscription_channel_payload_combo.present?
|
156
|
-
assert_valid_json(unsupported_subscription_channel_payload_combo)
|
157
|
-
channel_payload_combo = JSON.parse(unsupported_subscription_channel_payload_combo)
|
158
|
-
channel_value = channel_payload_combo['channel']
|
159
|
-
payload_value = channel_payload_combo['payload']
|
160
|
-
|
161
|
-
if channel_value.blank? || payload_value.blank?
|
162
|
-
add_message('error', %(
|
163
|
-
Channel and payload values are not populated correctly in unsupported channel and payload combination input.))
|
164
|
-
else
|
165
|
-
subscription_channel = subscription['channel']
|
166
|
-
subscription_channel['type'] = channel_value
|
167
|
-
subscription_channel['payload'] = payload_value
|
168
|
-
|
169
|
-
channel_path = ['channel', 'type']
|
170
|
-
payload_path = ['channel', 'payload']
|
171
|
-
|
172
|
-
send_unsupported_subscription(subscription, 'unsupported channel and payload combination', [channel_path, payload_path],
|
173
|
-
[channel_value, payload_value])
|
174
|
-
end
|
175
|
-
end
|
176
|
-
|
177
|
-
no_error_verification('Unsupported Subscription creation error handling failures.')
|
178
|
-
end
|
179
|
-
end
|
180
|
-
end
|
181
|
-
end
|