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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/lib/inferno_requirements_tools/tasks/collect_requirements.rb +51 -50
  3. data/lib/inferno_requirements_tools/tasks/requirements_coverage.rb +22 -19
  4. data/lib/subscriptions_test_kit/common/notification_conformance_verification.rb +11 -12
  5. data/lib/subscriptions_test_kit/common/subscription_conformance_verification.rb +14 -2
  6. data/lib/subscriptions_test_kit/docs/samples/Subscription_empty.json +1 -1
  7. data/lib/subscriptions_test_kit/docs/samples/Subscription_full-resource.json +1 -1
  8. data/lib/subscriptions_test_kit/docs/samples/Subscription_id-only.json +1 -1
  9. data/lib/subscriptions_test_kit/docs/subscriptions_r5_backport_r4_client_suite_description.md +4 -1
  10. data/lib/subscriptions_test_kit/docs/subscriptions_r5_backport_r4_server_suite_description.md +4 -1
  11. data/lib/subscriptions_test_kit/endpoints/subscription_create_endpoint.rb +7 -3
  12. data/lib/subscriptions_test_kit/endpoints/subscription_status_endpoint.rb +19 -13
  13. data/lib/subscriptions_test_kit/jobs/send_subscription_notifications.rb +7 -2
  14. data/lib/subscriptions_test_kit/requirements/generated/subscriptions-test-kit_requirements_coverage.csv +51 -51
  15. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/common/subscription_simulation_utils.rb +47 -16
  16. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification/notification_input_payload_verification_test.rb +15 -8
  17. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification/notification_input_verification_test.rb +8 -5
  18. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification/processing_attestation_test.rb +1 -1
  19. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification/subscription_verification_test.rb +3 -2
  20. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification_group.rb +1 -1
  21. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/interaction_test.rb +15 -11
  22. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/interaction_verification/event_notification_verification_test.rb +6 -5
  23. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/interaction_verification/handshake_notification_verification_test.rb +5 -5
  24. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/interaction_verification_group.rb +1 -1
  25. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client_suite.rb +5 -3
  26. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/capability_statement/cs_conformance_test.rb +1 -1
  27. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/capability_statement/topic_discovery_test.rb +3 -3
  28. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/capability_statement_group.rb +3 -3
  29. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/interaction/creation_response_conformance_test.rb +1 -1
  30. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/interaction/subscription_conformance_test.rb +11 -14
  31. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/interaction_group.rb +3 -3
  32. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/subscription_creation.rb +10 -1
  33. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/subscription_status_operation.rb +3 -2
  34. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/event_notification/empty_content_group.rb +3 -2
  35. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/event_notification/full_resource_content/full_resource_conformance_test.rb +3 -4
  36. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/event_notification/full_resource_content_group.rb +3 -2
  37. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/event_notification/id_only_content/id_only_conformance_test.rb +3 -4
  38. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/event_notification/id_only_content_group.rb +3 -2
  39. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/event_notification_group.rb +2 -2
  40. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/handshake_heartbeat/handshake_conformance_test.rb +7 -6
  41. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/handshake_heartbeat/heartbeat_conformance_test.rb +4 -2
  42. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/status_operation/status_invocation_test.rb +2 -2
  43. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/status_operation_group.rb +1 -1
  44. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_channel_endpoint_test.rb +65 -0
  45. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_channel_payload_combo_test.rb +76 -0
  46. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_channel_type_test.rb +68 -0
  47. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_cross_version_extension_test.rb +59 -0
  48. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_filter_test.rb +66 -0
  49. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_payload_type_test.rb +66 -0
  50. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_topic_test.rb +64 -0
  51. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection_group.rb +14 -2
  52. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server_suite.rb +3 -2
  53. data/lib/subscriptions_test_kit/version.rb +1 -3
  54. metadata +11 -75
  55. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscriptions_test.rb +0 -181
@@ -8,7 +8,7 @@ module SubscriptionsTestKit
8
8
  description %(
9
9
  This test group verifies that the Backport Subscriptions Server supports the $status operation.
10
10
  )
11
-
11
+
12
12
  test from: :subscriptions_r4_server_status_invocation
13
13
  end
14
14
  end
@@ -0,0 +1,65 @@
1
+ require_relative '../common/subscription_creation'
2
+
3
+ module SubscriptionsTestKit
4
+ module SubscriptionsR5BackportR4Server
5
+ class RejectSubscriptionChannelEndpointTest < Inferno::Test
6
+ include SubscriptionCreation
7
+
8
+ id :subscriptions_r4_server_reject_subscription_channel_endpoint
9
+ title 'Server Handles Unsupported Subscription Channel Endpoints'
10
+ description %(
11
+ When processing a request for a Subscription a server SHOULD verify that the Subscription is supported and does
12
+ not contain any information not implemented by the server. If the Subscription is not supported, the server
13
+ should reject the Subscription create request, or it should attempt to adjust the Subscription. When
14
+ processing a request for a Subscription, a server SHOULD validate that the channel endpoint is valid
15
+ for the channel provided (e.g., is it a valid URL of the expected type).
16
+
17
+ The test will pass if the server either
18
+ 1. rejects the Subscription by responding with a non-201 response, or
19
+ 2. updates the Subscription resource to remove or replace the unsupported value.
20
+ )
21
+
22
+ verifies_requirements 'hl7.fhir.uv.subscriptions_1.1.0@11'
23
+
24
+ input :subscription_resource,
25
+ title: 'Workflow Subscription Resource',
26
+ type: 'textarea',
27
+ description: %(
28
+ A Subscription resource in JSON format that Inferno will send to the server under test
29
+ so that it can demonstrate its ability to perform the Subscription creation and Notification
30
+ response workflow. The instance must be conformant to the R4/B Topic-Based Subscription profile.
31
+ Inferno may modify the Subscription before submission, e.g., to point to Inferno's notification endpoint.
32
+ This input is also used by the unsupported Subscription test as the base on which to add unsupported
33
+ element values to test for server rejection.
34
+ )
35
+ input :unsupported_subscription_channel_endpoint,
36
+ title: 'Unsupported Subscription Channel Endpoint',
37
+ description: 'An unsupported value for the `channel.endpoint` element to test for Subscription rejection.',
38
+ optional: true
39
+
40
+ run do
41
+ skip_if(unsupported_subscription_channel_endpoint.blank?, %(
42
+ Provide a value in the "Unsupported Subscription Channel Endpoint" input to run this test.))
43
+
44
+ assert_valid_json(subscription_resource)
45
+ subscription = JSON.parse(subscription_resource)
46
+
47
+ unsupported_info = {
48
+ 'unsupported_title' => 'unsupported channel URL',
49
+ 'field_path' => ['channel', 'endpoint'],
50
+ 'field_value' => unsupported_subscription_channel_endpoint
51
+ }
52
+
53
+ field_name = unsupported_info['field_path'].last
54
+ outer_field_name = unsupported_info['field_path'].first
55
+ subscription_field = subscription[outer_field_name]
56
+ subscription_field[field_name] = unsupported_info['field_value']
57
+
58
+ send_unsupported_subscription(subscription, unsupported_info['unsupported_title'],
59
+ [unsupported_info['field_path']], [unsupported_info['field_value']])
60
+
61
+ no_error_verification('Unsupported Subscription creation error handling failures.')
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,76 @@
1
+ require_relative '../common/subscription_creation'
2
+
3
+ module SubscriptionsTestKit
4
+ module SubscriptionsR5BackportR4Server
5
+ class RejectSubscriptionChannelPayloadComboTest < Inferno::Test
6
+ include SubscriptionCreation
7
+
8
+ id :subscriptions_r4_server_reject_subscription_channel_payload_combo
9
+ title 'Server Handles Unsupported Subscription Payload for Channel Type'
10
+ description %(
11
+ When processing a request for a Subscription a server SHOULD verify that the Subscription is supported and does
12
+ not contain any information not implemented by the server. If the Subscription is not supported, the server
13
+ should reject the Subscription create request, or it should attempt to adjust the Subscription. When
14
+ processing a request for a Subscription, a server SHOULD validate, that the payload configuration is
15
+ valid for the channel type requested (e.g., complies with the server's security policy).
16
+
17
+ The test will pass if the server either
18
+ 1. rejects the Subscription by responding with a non-201 response, or
19
+ 2. updates the Subscription resource to remove or replace the unsupported value.
20
+ )
21
+
22
+ verifies_requirements 'hl7.fhir.uv.subscriptions_1.1.0@13'
23
+
24
+ input :subscription_resource,
25
+ title: 'Workflow Subscription Resource',
26
+ type: 'textarea',
27
+ description: %(
28
+ A Subscription resource in JSON format that Inferno will send to the server under test
29
+ so that it can demonstrate its ability to perform the Subscription creation and Notification
30
+ response workflow. The instance must be conformant to the R4/B Topic-Based Subscription profile.
31
+ Inferno may modify the Subscription before submission, e.g., to point to Inferno's notification endpoint.
32
+ This input is also used by the unsupported Subscription test as the base on which to add unsupported
33
+ element values to test for server rejection.
34
+ )
35
+ input :unsupported_subscription_channel_payload_combo,
36
+ title: 'Unsupported Subscription Channel and Payload Combination',
37
+ description: %(
38
+ A channel (`channel.type`) and payload type (`content` extension under the `channel.payload` element)
39
+ combination not implemented by the server to test for Subscription
40
+ rejection. Provide as a JSON object with two keys as follows: {"channel": "channel_type",
41
+ "payload": "wrong_payload_type_for_this_channel"}.
42
+ ),
43
+ optional: true
44
+
45
+ run do
46
+ skip_if(unsupported_subscription_channel_payload_combo.blank?, %(
47
+ Provide a value in the "Unsupported Subscription Channel and Payload Combination" input to run this test.))
48
+
49
+ assert_valid_json(subscription_resource)
50
+ subscription = JSON.parse(subscription_resource)
51
+
52
+ assert_valid_json(unsupported_subscription_channel_payload_combo)
53
+ channel_payload_combo = JSON.parse(unsupported_subscription_channel_payload_combo)
54
+ channel_value = channel_payload_combo['channel']
55
+ payload_value = channel_payload_combo['payload']
56
+
57
+ if channel_value.blank? || payload_value.blank?
58
+ add_message('error', %(Channel and payload values are not populated correctly in unsupported channel and
59
+ payload combination input.))
60
+ else
61
+ subscription_channel = subscription['channel']
62
+ subscription_channel['type'] = channel_value
63
+ subscription_channel['payload'] = payload_value
64
+
65
+ channel_path = ['channel', 'type']
66
+ payload_path = ['channel', 'payload']
67
+
68
+ send_unsupported_subscription(subscription, 'unsupported channel and payload combination',
69
+ [channel_path, payload_path], [channel_value, payload_value])
70
+ end
71
+
72
+ no_error_verification('Unsupported Subscription creation error handling failures.')
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,68 @@
1
+ require_relative '../common/subscription_creation'
2
+
3
+ module SubscriptionsTestKit
4
+ module SubscriptionsR5BackportR4Server
5
+ class RejectSubscriptionChannelTypeTest < Inferno::Test
6
+ include SubscriptionCreation
7
+
8
+ id :subscriptions_r4_server_reject_subscription_channel_type
9
+ title 'Server Handles Unsupported Subscription Channel Types'
10
+ description %(
11
+ When processing a request for a Subscription a server SHOULD verify that the Subscription is supported and does
12
+ not contain any information not implemented by the server. If the Subscription is not supported, the server
13
+ should reject the Subscription create request, or it should attempt to adjust the Subscription. When
14
+ processing a request for a Subscription a server SHOULD validat that the channel type is known
15
+ and implemented by the server.
16
+
17
+ The test will pass if the server either
18
+ 1. rejects the Subscription by responding with a non-201 response, or
19
+ 2. updates the Subscription resource to remove or replace the unsupported value.
20
+ )
21
+
22
+ verifies_requirements 'hl7.fhir.uv.subscriptions_1.1.0@10'
23
+
24
+ input :subscription_resource,
25
+ title: 'Workflow Subscription Resource',
26
+ type: 'textarea',
27
+ description: %(
28
+ A Subscription resource in JSON format that Inferno will send to the server under test
29
+ so that it can demonstrate its ability to perform the Subscription creation and Notification
30
+ response workflow. The instance must be conformant to the R4/B Topic-Based Subscription profile.
31
+ Inferno may modify the Subscription before submission, e.g., to point to Inferno's notification endpoint.
32
+ This input is also used by the unsupported Subscription test as the base on which to add unsupported
33
+ element values to test for server rejection.
34
+ )
35
+ input :unsupported_subscription_channel_type,
36
+ title: 'Unsupported Subscription Channel Type',
37
+ description: %(A value for the `channel.type` element that is not implemented by the server to test for
38
+ Subscription rejection.),
39
+ optional: true
40
+
41
+ run do
42
+ skip_if(unsupported_subscription_channel_type.blank?, %(
43
+ Provide a value in the "Unsupported Subscription Channel Type" input to run this test.))
44
+
45
+ assert_valid_json(subscription_resource)
46
+ subscription = JSON.parse(subscription_resource)
47
+
48
+ unsupported_info = {
49
+ 'unsupported_title' => 'unsupported channel type',
50
+ 'field_path' => ['channel', 'type'],
51
+ 'field_value' => unsupported_subscription_channel_type
52
+ }
53
+
54
+ field_name = unsupported_info['field_path'].last
55
+ outer_field_name = unsupported_info['field_path'].first
56
+ subscription_field = subscription[outer_field_name]
57
+ subscription_field[field_name] = unsupported_info['field_value']
58
+
59
+ subscription_field[field_name] = unsupported_info['field_value']
60
+
61
+ send_unsupported_subscription(subscription, unsupported_info['unsupported_title'],
62
+ [unsupported_info['field_path']], [unsupported_info['field_value']])
63
+
64
+ no_error_verification('Unsupported Subscription creation error handling failures.')
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,59 @@
1
+ require_relative '../common/subscription_creation'
2
+
3
+ module SubscriptionsTestKit
4
+ module SubscriptionsR5BackportR4Server
5
+ class RejectSubscriptionCrossVersionExtensionTest < Inferno::Test
6
+ include SubscriptionCreation
7
+
8
+ id :subscriptions_r4_server_reject_subscription_cross_version_extension
9
+ title 'Server Handles Unsupported Cross-Version Extensions'
10
+ description %(
11
+ When processing a request for a Subscription a server SHOULD verify that the Subscription is supported and does
12
+ not contain any information not implemented by the server. If the Subscription is not supported, the server
13
+ should reject the Subscription create request, or it should attempt to adjust the Subscription. Since the FHIR
14
+ R5 is currently under development, there are no guarantees these extensions will meet the requirements of
15
+ this guide. In order to promote widespread compatibility, cross version extensions SHOULD NOT be used
16
+ on R4 subscriptions to describe any elements.
17
+
18
+ The test will pass if the server rejects the Subscription by responding with a non-201 response.
19
+ )
20
+
21
+ input :subscription_resource,
22
+ title: 'Workflow Subscription Resource',
23
+ type: 'textarea',
24
+ description: %(
25
+ A Subscription resource in JSON format that Inferno will send to the server under test
26
+ so that it can demonstrate its ability to perform the Subscription creation and Notification
27
+ response workflow. The instance must be conformant to the R4/B Topic-Based Subscription profile.
28
+ Inferno may modify the Subscription before submission, e.g., to point to Inferno's notification endpoint.
29
+ This input is also used by the unsupported Subscription test as the base on which to add unsupported
30
+ element values to test for server rejection.
31
+ )
32
+
33
+ run do
34
+ assert_valid_json(subscription_resource)
35
+ subscription = JSON.parse(subscription_resource)
36
+
37
+ unsupported_info = {
38
+ 'unsupported_title' => 'cross-version extensions',
39
+ 'field_path' => ['_criteria'],
40
+ 'field_value' => { 'extension' => [{
41
+ url: 'http://hl7.org/fhir/5.0/subscriptions-backport/StructureDefinition/backport-filter-criteria',
42
+ valueString: 'Encounter.patient=Patient/123'
43
+ }] }
44
+ }
45
+
46
+ field_name = unsupported_info['field_path'].last
47
+ subscription[field_name] = unsupported_info['field_value']
48
+
49
+ fhir_operation('/Subscription', body: subscription)
50
+ if request.status == 201
51
+ add_message('error', %(
52
+ Sending a Subscription with #{unsupported_info['unsupported_title']} should be rejected.))
53
+ end
54
+
55
+ no_error_verification('Unsupported Subscription creation error handling failures.')
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,66 @@
1
+ require_relative '../common/subscription_creation'
2
+
3
+ module SubscriptionsTestKit
4
+ module SubscriptionsR5BackportR4Server
5
+ class RejectSubscriptionFilterTest < Inferno::Test
6
+ include SubscriptionCreation
7
+
8
+ id :subscriptions_r4_server_reject_subscription_filter
9
+ title 'Server Handles Unsupported Subscription Filters'
10
+ description %(
11
+ When processing a request for a Subscription a server SHOULD verify that the Subscription is supported and does
12
+ not contain any information not implemented by the server. If the Subscription is not supported, the server
13
+ should reject the Subscription create request, or it should attempt to adjust the Subscription. When
14
+ processing a request for a Subscription, a server SHOULD validate that all requested filters are
15
+ defined in the requested topic and are implemented in the server.
16
+
17
+ The test will pass if the server either
18
+ 1. rejects the Subscription by responding with a non-201 response, or
19
+ 2. updates the Subscription resource to remove or replace the unsupported value.
20
+ )
21
+
22
+ verifies_requirements 'hl7.fhir.uv.subscriptions_1.1.0@9'
23
+
24
+ input :subscription_resource,
25
+ title: 'Workflow Subscription Resource',
26
+ type: 'textarea',
27
+ description: %(
28
+ A Subscription resource in JSON format that Inferno will send to the server under test
29
+ so that it can demonstrate its ability to perform the Subscription creation and Notification
30
+ response workflow. The instance must be conformant to the R4/B Topic-Based Subscription profile.
31
+ Inferno may modify the Subscription before submission, e.g., to point to Inferno's notification endpoint.
32
+ This input is also used by the unsupported Subscription test as the base on which to add unsupported
33
+ element values to test for server rejection.
34
+ )
35
+ input :unsupported_subscription_filter,
36
+ title: 'Unsupported Subscription Filter',
37
+ description: %(A value for `filterCriteria` extension under the `criteria` that is not implemented by the
38
+ server to test for Subscription rejection.),
39
+ optional: true
40
+
41
+ run do
42
+ skip_if(unsupported_subscription_filter.blank?, %(
43
+ Provide a value in the "Unsupported Subscription Filter" input to run this test.))
44
+
45
+ assert_valid_json(subscription_resource)
46
+ subscription = JSON.parse(subscription_resource)
47
+
48
+ unsupported_info = {
49
+ 'unsupported_title' => 'unsupported filter criteria',
50
+ 'field_path' => ['_criteria'],
51
+ 'field_value' => { 'extension' => [{
52
+ url: 'http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-filter-criteria',
53
+ valueString: unsupported_subscription_filter
54
+ }] }
55
+ }
56
+
57
+ field_name = unsupported_info['field_path'].last
58
+ subscription[field_name] = unsupported_info['field_value']
59
+ send_unsupported_subscription(subscription, unsupported_info['unsupported_title'],
60
+ [unsupported_info['field_path']], [unsupported_info['field_value']])
61
+
62
+ no_error_verification('Unsupported Subscription creation error handling failures.')
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,66 @@
1
+ require_relative '../common/subscription_creation'
2
+
3
+ module SubscriptionsTestKit
4
+ module SubscriptionsR5BackportR4Server
5
+ class RejectSubscriptionPayloadTypeTest < Inferno::Test
6
+ include SubscriptionCreation
7
+
8
+ id :subscriptions_r4_server_reject_subscription_payload_type
9
+ title 'Server Handles Unsupported Subscription Payload Types'
10
+ description %(
11
+ When processing a request for a Subscription a server SHOULD verify that the Subscription is supported and does
12
+ not contain any information not implemented by the server. If the Subscription is not supported, the server
13
+ should reject the Subscription create request, or it should attempt to adjust the Subscription. When
14
+ processing a request for a Subscription, a server SHOULD validate that the payload configuration is
15
+ known and implemented by the server.
16
+
17
+ The test will pass if the server either
18
+ 1. rejects the Subscription by responding with a non-201 response, or
19
+ 2. updates the Subscription resource to remove or replace the unsupported value.
20
+ )
21
+
22
+ verifies_requirements 'hl7.fhir.uv.subscriptions_1.1.0@12'
23
+
24
+ input :subscription_resource,
25
+ title: 'Workflow Subscription Resource',
26
+ type: 'textarea',
27
+ description: %(
28
+ A Subscription resource in JSON format that Inferno will send to the server under test
29
+ so that it can demonstrate its ability to perform the Subscription creation and Notification
30
+ response workflow. The instance must be conformant to the R4/B Topic-Based Subscription profile.
31
+ Inferno may modify the Subscription before submission, e.g., to point to Inferno's notification endpoint.
32
+ This input is also used by the unsupported Subscription test as the base on which to add unsupported
33
+ element values to test for server rejection.
34
+ )
35
+ input :unsupported_subscription_payload_type,
36
+ title: 'Unsupported Subscription Payload Type',
37
+ description: %(A value for the `content` extension under the `channel.payload` element that is not
38
+ implemented by the server to test for Subscription rejection.),
39
+ optional: true
40
+
41
+ run do
42
+ skip_if(unsupported_subscription_payload_type.blank?, %(
43
+ Provide a value in the "Unsupported Subscription Payload Type" input to run this test.))
44
+
45
+ assert_valid_json(subscription_resource)
46
+ subscription = JSON.parse(subscription_resource)
47
+
48
+ unsupported_info = {
49
+ 'unsupported_title' => 'unsupported payload type',
50
+ 'field_path' => ['channel', 'payload'],
51
+ 'field_value' => unsupported_subscription_payload_type
52
+ }
53
+
54
+ field_name = unsupported_info['field_path'].last
55
+ outer_field_name = unsupported_info['field_path'].first
56
+ subscription_field = subscription[outer_field_name]
57
+ subscription_field[field_name] = unsupported_info['field_value']
58
+
59
+ send_unsupported_subscription(subscription, unsupported_info['unsupported_title'],
60
+ [unsupported_info['field_path']], [unsupported_info['field_value']])
61
+
62
+ no_error_verification('Unsupported Subscription creation error handling failures.')
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,64 @@
1
+ require_relative '../common/subscription_creation'
2
+
3
+ module SubscriptionsTestKit
4
+ module SubscriptionsR5BackportR4Server
5
+ class RejectSubscriptionTopicTest < Inferno::Test
6
+ include SubscriptionCreation
7
+
8
+ id :subscriptions_r4_server_reject_subscription_topic
9
+ title 'Server Handles Unsupported Subscription Topics'
10
+ description %(
11
+ When processing a request for a Subscription a server SHOULD verify that the Subscription is supported and does
12
+ not contain any information not implemented by the server. If the Subscription is not supported, the server
13
+ should reject the Subscription create request, or it should attempt to adjust the Subscription. When
14
+ processing a request for a Subscription, a server SHOULD validate that the SubscriptionTopic is
15
+ valid and implemented by the server.
16
+
17
+ The test will pass if the server either
18
+ 1. rejects the Subscription by responding with a non-201 response, or
19
+ 2. updates the Subscription resource to remove or replace the unsupported value.
20
+ )
21
+
22
+ verifies_requirements 'hl7.fhir.uv.subscriptions_1.1.0@8'
23
+
24
+ input :subscription_resource,
25
+ title: 'Workflow Subscription Resource',
26
+ type: 'textarea',
27
+ description: %(
28
+ A Subscription resource in JSON format that Inferno will send to the server under test
29
+ so that it can demonstrate its ability to perform the Subscription creation and Notification
30
+ response workflow. The instance must be conformant to the R4/B Topic-Based Subscription profile.
31
+ Inferno may modify the Subscription before submission, e.g., to point to Inferno's notification endpoint.
32
+ This input is also used by the unsupported Subscription test as the base on which to add unsupported
33
+ element values to test for server rejection.
34
+ )
35
+ input :unsupported_subscription_topic,
36
+ title: 'Unsupported Subscription Topic',
37
+ description: %(A Subscription Topic for the `criteria` element that is not implemented by the server to test
38
+ for Subscription rejection.),
39
+ optional: true
40
+
41
+ run do
42
+ skip_if(unsupported_subscription_topic.blank?, %(
43
+ Provide a value in the "Unsupported Subscription Topic" input to run this test.))
44
+
45
+ assert_valid_json(subscription_resource)
46
+ subscription = JSON.parse(subscription_resource)
47
+
48
+ unsupported_info = {
49
+ 'unsupported_title' => 'unsupported `SubscriptionTopic`',
50
+ 'field_path' => ['criteria'],
51
+ 'field_value' => unsupported_subscription_topic
52
+ }
53
+
54
+ field_name = unsupported_info['field_path'].last
55
+ subscription[field_name] = unsupported_info['field_value']
56
+
57
+ send_unsupported_subscription(subscription, unsupported_info['unsupported_title'],
58
+ [unsupported_info['field_path']], [unsupported_info['field_value']])
59
+
60
+ no_error_verification('Unsupported Subscription creation error handling failures.')
61
+ end
62
+ end
63
+ end
64
+ end
@@ -1,4 +1,10 @@
1
- require_relative 'subscription_rejection/reject_subscriptions_test'
1
+ require_relative 'subscription_rejection/reject_subscription_channel_endpoint_test'
2
+ require_relative 'subscription_rejection/reject_subscription_channel_payload_combo_test'
3
+ require_relative 'subscription_rejection/reject_subscription_channel_type_test'
4
+ require_relative 'subscription_rejection/reject_subscription_cross_version_extension_test'
5
+ require_relative 'subscription_rejection/reject_subscription_filter_test'
6
+ require_relative 'subscription_rejection/reject_subscription_payload_type_test'
7
+ require_relative 'subscription_rejection/reject_subscription_topic_test'
2
8
 
3
9
  module SubscriptionsTestKit
4
10
  module SubscriptionsR5BackportR4Server
@@ -15,7 +21,13 @@ module SubscriptionsTestKit
15
21
  :unsupported_subscription_channel_endpoint, :unsupported_subscription_payload_type,
16
22
  :unsupported_subscription_channel_payload_combo
17
23
 
18
- test from: :subscriptions_r4_server_reject_subscriptions
24
+ test from: :subscriptions_r4_server_reject_subscription_cross_version_extension
25
+ test from: :subscriptions_r4_server_reject_subscription_topic
26
+ test from: :subscriptions_r4_server_reject_subscription_filter
27
+ test from: :subscriptions_r4_server_reject_subscription_channel_type
28
+ test from: :subscriptions_r4_server_reject_subscription_channel_endpoint
29
+ test from: :subscriptions_r4_server_reject_subscription_payload_type
30
+ test from: :subscriptions_r4_server_reject_subscription_channel_payload_combo
19
31
  end
20
32
  end
21
33
  end
@@ -15,7 +15,8 @@ module SubscriptionsTestKit
15
15
  title 'Subscriptions R5 Backport IG v1.1.0 FHIR R4 Server Test Suite'
16
16
  short_title 'Subscriptions R4 Server'
17
17
  version VERSION
18
- description File.read(File.join(__dir__, '..', 'docs', 'subscriptions_r5_backport_r4_server_suite_description.md'))
18
+ description File.read(File.join(__dir__, '..', 'docs',
19
+ 'subscriptions_r5_backport_r4_server_suite_description.md'))
19
20
 
20
21
  links [
21
22
  {
@@ -35,7 +36,7 @@ module SubscriptionsTestKit
35
36
  url: 'https://hl7.org/fhir/uv/subscriptions-backport/STU1.1/'
36
37
  }
37
38
  ]
38
-
39
+
39
40
  # These inputs will be available to all tests in this suite
40
41
  input :url,
41
42
  title: 'FHIR Server Base URL',
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module SubscriptionsTestKit
4
- VERSION = '0.9.2'.freeze
2
+ VERSION = '0.9.4'.freeze
5
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: subscriptions_test_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Naden, Emily Semple, Tom Strassner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-08 00:00:00.000000000 Z
11
+ date: 2025-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inferno_core
@@ -16,84 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.4.43
19
+ version: 0.5.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.4.43
27
- - !ruby/object:Gem::Dependency
28
- name: roo
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: 2.10.1
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: 2.10.1
41
- - !ruby/object:Gem::Dependency
42
- name: database_cleaner-sequel
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '1.8'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '1.8'
55
- - !ruby/object:Gem::Dependency
56
- name: factory_bot
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '6.1'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '6.1'
69
- - !ruby/object:Gem::Dependency
70
- name: rspec
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '3.10'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '3.10'
83
- - !ruby/object:Gem::Dependency
84
- name: webmock
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '3.11'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '3.11'
26
+ version: 0.5.0
97
27
  description: Inferno test kit for FHIR R5-style Subscriptions
98
28
  email:
99
29
  - inferno@groups.mitre.org
@@ -158,7 +88,13 @@ files:
158
88
  - lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/handshake_heartbeat_group.rb
159
89
  - lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/status_operation/status_invocation_test.rb
160
90
  - lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/status_operation_group.rb
161
- - lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscriptions_test.rb
91
+ - lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_channel_endpoint_test.rb
92
+ - lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_channel_payload_combo_test.rb
93
+ - lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_channel_type_test.rb
94
+ - lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_cross_version_extension_test.rb
95
+ - lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_filter_test.rb
96
+ - lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_payload_type_test.rb
97
+ - lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscription_topic_test.rb
162
98
  - lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection_group.rb
163
99
  - lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/workflow_group.rb
164
100
  - lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server_suite.rb