subscriptions_test_kit 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) 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 +4 -2
  5. data/lib/subscriptions_test_kit/endpoints/subscription_create_endpoint.rb +7 -3
  6. data/lib/subscriptions_test_kit/endpoints/subscription_status_endpoint.rb +16 -11
  7. data/lib/subscriptions_test_kit/requirements/generated/subscriptions-test-kit_requirements_coverage.csv +50 -50
  8. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/common/subscription_simulation_utils.rb +9 -6
  9. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification/notification_input_payload_verification_test.rb +2 -2
  10. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification/notification_input_verification_test.rb +1 -1
  11. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification/processing_attestation_test.rb +1 -1
  12. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification/subscription_verification_test.rb +2 -2
  13. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification_group.rb +1 -1
  14. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/interaction_test.rb +14 -11
  15. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/interaction_verification/event_notification_verification_test.rb +6 -5
  16. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/interaction_verification/handshake_notification_verification_test.rb +5 -5
  17. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/interaction_verification_group.rb +1 -1
  18. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client_suite.rb +5 -3
  19. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/capability_statement/cs_conformance_test.rb +1 -1
  20. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/capability_statement/topic_discovery_test.rb +3 -3
  21. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/capability_statement_group.rb +3 -3
  22. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/interaction/creation_response_conformance_test.rb +1 -1
  23. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/interaction/subscription_conformance_test.rb +10 -9
  24. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/interaction_group.rb +3 -3
  25. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/subscription_status_operation.rb +3 -2
  26. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/event_notification/empty_content_group.rb +3 -2
  27. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/event_notification/full_resource_content/full_resource_conformance_test.rb +2 -2
  28. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/event_notification/full_resource_content_group.rb +3 -2
  29. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/event_notification/id_only_content/id_only_conformance_test.rb +2 -2
  30. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/event_notification/id_only_content_group.rb +3 -2
  31. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/event_notification_group.rb +2 -2
  32. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/handshake_heartbeat/handshake_conformance_test.rb +7 -6
  33. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/handshake_heartbeat/heartbeat_conformance_test.rb +4 -2
  34. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/status_operation/status_invocation_test.rb +2 -2
  35. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/status_operation_group.rb +1 -1
  36. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/subscription_rejection/reject_subscriptions_test.rb +29 -25
  37. data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server_suite.rb +3 -2
  38. data/lib/subscriptions_test_kit/version.rb +1 -3
  39. metadata +4 -74
@@ -17,19 +17,20 @@ module SubscriptionsTestKit
17
17
  Afterwards, Inferno will no longer respond to requests.
18
18
 
19
19
  To create the handshake and event notifications, Inferno uses the contents of the *Event
20
- Notification Bundle* input. The provided notification will be modified as appropriate for
20
+ Notification Bundle* input. The provided notification will be modified as appropriate for
21
21
  the request Inferno is making:
22
22
  - General changes for all notification types
23
23
  - update the `subscription` parameter entry reference.
24
24
  - update the `status` parameter entry based on the previous interactions.
25
- - update the `type` parameter entry based on the notification type (e.g., `event-notification` or `handshake`).
25
+ - update the `type` parameter entry based on the notification type (e.g., `event-notification` or
26
+ `handshake`).
26
27
  - update the number of notifications sent in the `events-since-subscription-start` parameter entry.
27
28
  - `handshake`-specific changes:
28
29
  - clear the `events` parameter entry.
29
30
  - clear the `errors` parameter entry.
30
31
 
31
- While the provided Notification must be conformant to the
32
- [R4 Topic-Based Subscription Notification Bundle
32
+ While the provided Notification must be conformant to the
33
+ [R4 Topic-Based Subscription Notification Bundle
33
34
  profile](https://hl7.org/fhir/uv/subscriptions-backport/STU1.1/StructureDefinition-backport-subscription-notification-r4.html)
34
35
  for the tests to pass, the tests can run as long as the notification meets the
35
36
  following minimal requirements:
@@ -49,10 +50,10 @@ module SubscriptionsTestKit
49
50
  optional: true,
50
51
  title: 'Client Notification Access Token',
51
52
  description: %(
52
- The bearer token that Inferno will send on requests to the client under test's rest-hook notification endpoint. Not
53
- needed if the client under test will create a Subscription with an appropriate header value in the
54
- `channel.header` element. If a value for the `authorization` header is provided in `channel.header`, this
55
- value will override it.
53
+ The bearer token that Inferno will send on requests to the client under test's rest-hook notification
54
+ endpoint. Not needed if the client under test will create a Subscription with an appropriate header value
55
+ in the `channel.header` element. If a value for the `authorization` header is provided in
56
+ `channel.header`, this value will override it.
56
57
  )
57
58
  input :notification_bundle,
58
59
  title: 'Event Notification Bundle',
@@ -67,7 +68,9 @@ module SubscriptionsTestKit
67
68
 
68
69
  run do
69
70
  minimally_validate_notification(notification_bundle)
70
- assert(messages.none? { |m| m[:type] == 'error' }, 'Notification Bundle input is invalid for use by Inferno, see error message(s)')
71
+ assert(messages.none? do |m|
72
+ m[:type] == 'error'
73
+ end, 'Notification Bundle input is invalid for use by Inferno, see error message(s)')
71
74
 
72
75
  wait(
73
76
  identifier: access_token,
@@ -118,11 +121,11 @@ module SubscriptionsTestKit
118
121
  # Require the subscription param, just because we need something to later identify the subscription status
119
122
  # bundle entry. Note we could just as easily use a different required param, like status or type.
120
123
  subscription_param = subscription_status.parameter&.find { |p| p.name == 'subscription' }
121
- assert(subscription_param.present?, 'Subscription status entry in notification bundle input must contain a'\
124
+ assert(subscription_param.present?, 'Subscription status entry in notification bundle input must contain a' \
122
125
  'subscription parameter')
123
126
  rescue Inferno::Exceptions::AssertionException => e
124
127
  add_message('error', e.message)
125
128
  end
126
129
  end
127
130
  end
128
- end
131
+ end
@@ -23,18 +23,19 @@ module SubscriptionsTestKit
23
23
  # The SendSubscriptionNotifications job saves a nil status if the request fails entirely
24
24
  assert(request.status.present?, "Handshake notification request failed with error: #{request.response_body}")
25
25
 
26
- assert(request.status.between?(200, 299), "Event notification was not successful, status code #{request.status}")
26
+ assert(request.status.between?(200, 299),
27
+ "Event notification was not successful, status code #{request.status}")
27
28
 
28
29
  subscription = find_subscription(test_session_id)
29
30
  if subscription.present?
30
31
  mime_type = subscription&.channel&.payload
31
32
  unless ALLOWED_MIME_TYPES.include?(mime_type)
32
- add_message('warning', %(Subscription specified '#{mime_type}' for `Subscription.channel.payload`, but Inferno
33
- only supports: #{ALLOWED_MIME_TYPES.map { |type| "'#{type}'" }.join(', ')}.
34
- Event notification was sent with Content-Type: '#{DEFAULT_MIME_TYPE}'.))
33
+ add_message('warning', %(Subscription specified '#{mime_type}' for `Subscription.channel.payload`, but
34
+ Inferno only supports: #{ALLOWED_MIME_TYPES.map { |type| "'#{type}'" }.join(', ')}.
35
+ Event notification was sent with Content-Type: '#{DEFAULT_MIME_TYPE}'.))
35
36
  end
36
37
  end
37
38
  end
38
39
  end
39
40
  end
40
- end
41
+ end
@@ -23,18 +23,18 @@ module SubscriptionsTestKit
23
23
  assert(request.status.present?, "Handshake notification request failed with error: #{request.response_body}")
24
24
 
25
25
  assert(request.status.between?(200, 299),
26
- "Handshake notification was not successful, status code #{request.status}")
26
+ "Handshake notification was not successful, status code #{request.status}")
27
27
 
28
28
  subscription = find_subscription(test_session_id)
29
29
  if subscription.present?
30
30
  mime_type = subscription&.channel&.payload
31
31
  unless ALLOWED_MIME_TYPES.include?(mime_type)
32
- add_message('warning', %(Subscription specified '#{mime_type}' for `Subscription.channel.payload`, but Inferno
33
- only supports: #{ALLOWED_MIME_TYPES.map { |type| "'#{type}'" }.join(', ')}.
34
- Handshake notification was sent with Content-Type: '#{DEFAULT_MIME_TYPE}'.))
32
+ add_message('warning', %(Subscription specified '#{mime_type}' for `Subscription.channel.payload`, but
33
+ Inferno only supports: #{ALLOWED_MIME_TYPES.map { |type| "'#{type}'" }.join(', ')}.
34
+ Handshake notification was sent with Content-Type: '#{DEFAULT_MIME_TYPE}'.))
35
35
  end
36
36
  end
37
37
  end
38
38
  end
39
39
  end
40
- end
40
+ end
@@ -13,4 +13,4 @@ module SubscriptionsTestKit
13
13
  test from: :subscriptions_r4_client_event_notification_verification
14
14
  end
15
15
  end
16
- end
16
+ end
@@ -13,7 +13,8 @@ module SubscriptionsTestKit
13
13
  title 'Subscriptions R5 Backport IG v1.1.0 FHIR R4 Client Test Suite'
14
14
  short_title 'Subscriptions R4 Client'
15
15
  version VERSION
16
- description File.read(File.join(__dir__, '..', 'docs', 'subscriptions_r5_backport_r4_client_suite_description.md'))
16
+ description File.read(File.join(__dir__, '..', 'docs',
17
+ 'subscriptions_r5_backport_r4_client_suite_description.md'))
17
18
 
18
19
  links [
19
20
  {
@@ -43,7 +44,8 @@ module SubscriptionsTestKit
43
44
  end
44
45
  end
45
46
 
46
- capability_statement = File.read(File.join(__dir__, 'subscriptions_r5_backport_r4_client', 'fixtures', 'capability_statement.json'))
47
+ capability_statement = File.read(File.join(__dir__, 'subscriptions_r5_backport_r4_client', 'fixtures',
48
+ 'capability_statement.json'))
47
49
  route(:get, '/fhir/metadata', proc { [200, { 'Content-Type' => 'application/json' }, [capability_statement]] })
48
50
 
49
51
  suite_endpoint :post, FHIR_SUBSCRIPTION_PATH, SubscriptionCreateEndpoint
@@ -63,4 +65,4 @@ module SubscriptionsTestKit
63
65
  group from: :subscriptions_r4_client_workflow
64
66
  end
65
67
  end
66
- end
68
+ end
@@ -33,7 +33,7 @@ module SubscriptionsTestKit
33
33
  assert(rest_subscription.present?, 'Capability Statement missing `Subscription` resource in `rest` field')
34
34
 
35
35
  assert(rest_subscription.supportedProfile.present?,
36
- 'Capability Statement missing the `supportedProfile` field in `Subscription` resource')
36
+ 'Capability Statement missing the `supportedProfile` field in `Subscription` resource')
37
37
 
38
38
  subscription_profile_present = rest_subscription.supportedProfile.any? do |profile|
39
39
  profile == subscription_profile_url
@@ -59,7 +59,7 @@ module SubscriptionsTestKit
59
59
  assert(rest_subscription.present?, 'Capability Statement missing `Subscription` resource in `rest` field')
60
60
 
61
61
  assert(rest_subscription.extension.present?,
62
- 'Capability Statement missing the `extension` field on the Subscription resource')
62
+ 'Capability Statement missing the `extension` field on the Subscription resource')
63
63
  subscription_topic_extension = rest_subscription.extension.select do |elem|
64
64
  elem.url == capability_statement_subscriptiontopic_extension
65
65
  end
@@ -97,8 +97,8 @@ module SubscriptionsTestKit
97
97
  )
98
98
  else
99
99
  add_message('warning', %(
100
- No Subscription requests have been made in previous tests. Run the Subscription workflow tests first in order
101
- to verify topics found in the SubscriptionTopic Canonical extension))
100
+ No Subscription requests have been made in previous tests. Run the Subscription workflow tests first in
101
+ order to verify topics found in the SubscriptionTopic Canonical extension))
102
102
  end
103
103
  end
104
104
  end
@@ -7,9 +7,9 @@ module SubscriptionsTestKit
7
7
  id :subscriptions_r4_server_capability_statement
8
8
  title 'Capability Statement Verification'
9
9
  description %(
10
- Verify the Backport Subscriptions Server has a conformant Capability Statement and that it declares support for the
11
- Backport Subscription Profile on the Subscription resource in the rest field. Then the group will verify if the
12
- server supports topic discovert via the Capability Statement, which is an optional requirement.
10
+ Verify the Backport Subscriptions Server has a conformant Capability Statement and that it declares support for
11
+ the Backport Subscription Profile on the Subscription resource in the rest field. Then the group will verify if
12
+ the server supports topic discovert via the Capability Statement, which is an optional requirement.
13
13
  )
14
14
 
15
15
  run_as_group
@@ -43,7 +43,7 @@ module SubscriptionsTestKit
43
43
  assert_resource_type('Subscription', resource: subscription)
44
44
 
45
45
  assert(subscription.channel.type == 'rest-hook' && subscription.status == 'requested',
46
- "The Subscription resource should have it's status set to 'requested', was '#{subscription.status}'")
46
+ "The Subscription resource should have it's status set to 'requested', was '#{subscription.status}'")
47
47
  end
48
48
  end
49
49
  end
@@ -11,21 +11,22 @@ module SubscriptionsTestKit
11
11
  The Subscription resource is used to request notifications for a specific client about a specific topic
12
12
  Conceptually, a subscription is a concrete request for a single client to receive notifications per a single
13
13
  topic. In order to support topic-based subscriptions in R4, this guide defines several extensions for use on the
14
- [R4 Subscription resource](http://hl7.org/fhir/R4/subscription.html). A list of extensions defined by this guide can
15
- be found on the [Subscriptions R5 Backport IG's Artifacts page](https://hl7.org/fhir/uv/subscriptions-backport/STU1.1/artifacts.html#5).
14
+ [R4 Subscription resource](http://hl7.org/fhir/R4/subscription.html). A list of extensions defined by this guide
15
+ can be found on the
16
+ [Subscriptions R5 Backport IG's Artifacts page](https://hl7.org/fhir/uv/subscriptions-backport/STU1.1/artifacts.html#5).
16
17
 
17
- This test accepts a Subscription resource as an input and verifies that it is conformant to the
18
+ This test accepts a Subscription resource as an input and verifies that it is conformant to the
18
19
  [R4/B Topic-Based Subscription profile](https://hl7.org/fhir/uv/subscriptions-backport/STU1.1/StructureDefinition-backport-subscription.html).
19
20
 
20
21
  The Subscription channel should have it's fields populated with the following information:
21
22
  - The `endpoint` field must be set to
22
- `#{Inferno::Application['base_url']}/custom/subscriptions_r5_backport_r4_server/subscription/channel/notification_listener`.
23
+ `#{Inferno::Application['base_url']}/custom/subscriptions_r5_backport_r4_server#{SUBSCRIPTION_CHANNEL_PATH}`.
23
24
  The test will add the correct url to this field if it is not properly set.
24
25
  - The `type` field must be set to `rest-hook`, as the Inferno subscription workflow tests use a `rest-hook`
25
26
  subscription channel to receive incoming notifications. The test will add the correct type to this field if it
26
27
  is not properly set.
27
- - The `payload` field must be set to `application/json`, as Inferno will only accept resources in requests with
28
- this content type.
28
+ - The `payload` field must be set to `application/json`, as Inferno will only accept resources in requests
29
+ with this content type.
29
30
  - The `header` field must include the `Authorization` header with a Bearer token set to the inputted Inferno
30
31
  access token.
31
32
  )
@@ -41,8 +42,8 @@ module SubscriptionsTestKit
41
42
  so that it can demonstrate its ability to perform the Subscription creation and Notification
42
43
  response workflow. The instance must be conformant to the R4/B Topic-Based Subscription profile.
43
44
  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.
45
+ This input is also used by the unsupported Subscription test as the base on which to add unsupported
46
+ element values to test for server rejection.
46
47
  )
47
48
  input :access_token,
48
49
  title: 'Notification Access Token',
@@ -61,7 +62,7 @@ module SubscriptionsTestKit
61
62
  no_error_verification('Subscription resource is not conformant.')
62
63
 
63
64
  assert(subscription['criteria'].present?,
64
- 'The `criteria` field SHALL be populated and contain the canonical URL for the Subscription Topic.')
65
+ 'The `criteria` field SHALL be populated and contain the canonical URL for the Subscription Topic.')
65
66
  output subscription_topic: subscription['criteria']
66
67
 
67
68
  subscription = server_check_channel(subscription, access_token)
@@ -9,9 +9,9 @@ module SubscriptionsTestKit
9
9
  title 'Subscription Workflow Interaction'
10
10
  description %(
11
11
  Verify that the Subscription instance the tester provided is conformant, and then demonstrate the ability of the
12
- server under test to accept a request for the creation of a FHIR Subscription instance and deliver a notification
13
- for that Subscription. Inferno will act as a client, creating the Subscription and waiting for a notification
14
- based on it.
12
+ server under test to accept a request for the creation of a FHIR Subscription instance and deliver a
13
+ notification for that Subscription. Inferno will act as a client, creating the Subscription and waiting for a
14
+ notification based on it.
15
15
  )
16
16
 
17
17
  run_as_group
@@ -17,7 +17,8 @@ module SubscriptionsTestKit
17
17
  assert_resource_type('Bundle')
18
18
 
19
19
  unless resource.type == 'searchset'
20
- add_message('error', "Bundle returned from $status operation should be type 'searchset', was #{resource.type}")
20
+ add_message('error',
21
+ "Bundle returned from $status operation should be type 'searchset', was #{resource.type}")
21
22
  end
22
23
 
23
24
  assert_valid_resource
@@ -39,7 +40,7 @@ module SubscriptionsTestKit
39
40
  entry.resource.resourceType == 'Parameters' && subscription_ref_found?(entry, subscription_id)
40
41
  end
41
42
  assert(subscription_status_entry,
42
- "No Subscription status with id #{subscription_id} returned from $status operation")
43
+ "No Subscription status with id #{subscription_id} returned from $status operation")
43
44
 
44
45
  subscription_status_resource = subscription_status_entry.resource
45
46
  assert_valid_resource(resource: subscription_status_resource,
@@ -31,9 +31,10 @@ module SubscriptionsTestKit
31
31
  type: 'textarea',
32
32
  description: %(
33
33
  A Subscription resource in JSON format that Inferno will send to the server under test
34
- so that it can demonstrate its ability to send an empty Notification.
34
+ so that it can demonstrate its ability to send an empty Notification.
35
35
  The instance must be conformant to the R4/B Topic-Based Subscription profile.
36
- Inferno may modify the Subscription before submission, e.g., to point to Inferno's notification endpoint.
36
+ Inferno may modify the Subscription before submission, e.g., to point to Inferno's notification
37
+ endpoint.
37
38
  ),
38
39
  optional: true
39
40
  },
@@ -12,8 +12,8 @@ module SubscriptionsTestKit
12
12
  [R4 Topic-Based Subscription Notification Bundle](https://hl7.org/fhir/uv/subscriptions-backport/STU1.1/StructureDefinition-backport-subscription-notification-r4.html)
13
13
  profle.
14
14
 
15
- With the content type of full-resource, the resources involved in triggering the notification are included in the
16
- notification bundle.
15
+ With the content type of full-resource, the resources involved in triggering the notification are included in
16
+ the notification bundle.
17
17
 
18
18
  When the content type is full-resource, notification bundles SHALL include references to the
19
19
  appropriate focus resources in the SubscriptionStatus.notificationEvent.focus element.
@@ -31,9 +31,10 @@ module SubscriptionsTestKit
31
31
  type: 'textarea',
32
32
  description: %(
33
33
  A Subscription resource in JSON format that Inferno will send to the server under test
34
- so that it can demonstrate its ability to send a full-resource Notification.
34
+ so that it can demonstrate its ability to send a full-resource Notification.
35
35
  The instance must be conformant to the R4/B Topic-Based Subscription profile.
36
- Inferno may modify the Subscription before submission, e.g., to point to Inferno's notification endpoint.
36
+ Inferno may modify the Subscription before submission, e.g., to point to Inferno's notification
37
+ endpoint.
37
38
  ),
38
39
  optional: true
39
40
  },
@@ -15,8 +15,8 @@ module SubscriptionsTestKit
15
15
  With the content type of id-only, the resources involved in triggering the notification are only available
16
16
  through other channels, but notifications include URLs which can be used to access those resources.
17
17
 
18
- When the content type is id-only, notification bundles SHALL include references to the appropriate focus resources
19
- in the SubscriptionStatus.notificationEvent.focus element.
18
+ When the content type is id-only, notification bundles SHALL include references to the appropriate focus
19
+ resources in the SubscriptionStatus.notificationEvent.focus element.
20
20
 
21
21
  Additionally, notification bundles MAY contain, in addition to the SubscriptionStatus used to convey status
22
22
  information, at least one Bundle.entry for each resource relevant to the notification.
@@ -31,9 +31,10 @@ module SubscriptionsTestKit
31
31
  type: 'textarea',
32
32
  description: %(
33
33
  A Subscription resource in JSON format that Inferno will send to the server under test
34
- so that it can demonstrate its ability to send an id-only Notification.
34
+ so that it can demonstrate its ability to send an id-only Notification.
35
35
  The instance must be conformant to the R4/B Topic-Based Subscription profile.
36
- Inferno may modify the Subscription before submission, e.g., to point to Inferno's notification endpoint.
36
+ Inferno may modify the Subscription before submission, e.g., to point to Inferno's notification
37
+ endpoint.
37
38
  ),
38
39
  optional: true
39
40
  },
@@ -10,8 +10,8 @@ module SubscriptionsTestKit
10
10
  description %(
11
11
  Verify that the received Notifications are conformant to the
12
12
  [R4 Topic-Based Subscription Notification Bundle](https://hl7.org/fhir/uv/subscriptions-backport/STU1.1/StructureDefinition-backport-subscription-notification-r4.html)
13
- profile, including additional requirements around the content type. This group contains tests for the three options
14
- available when specifying the contents of a Notification: empty, id-only, and full-resource.
13
+ profile, including additional requirements around the content type. This group contains tests for the three
14
+ options available when specifying the contents of a Notification: empty, id-only, and full-resource.
15
15
  )
16
16
 
17
17
  input_order :url, :credentials, :access_token, :empty_subscription_resource,
@@ -9,9 +9,9 @@ module SubscriptionsTestKit
9
9
  title 'Subscription Handshake Verification'
10
10
  description %(
11
11
  When a Subscription is created for a REST Hook channel type, the server SHALL set initial status to requested,
12
- pending verification of the nominated endpoint URL. The Server will then send a handshake bundle to the endpoint.
13
- After a successful handshake notification has been sent and accepted, the server SHALL update the status to
14
- active. This test verifies that the incoming handshake request is a conformant
12
+ pending verification of the nominated endpoint URL. The Server will then send a handshake bundle to the
13
+ endpoint. After a successful handshake notification has been sent and accepted, the server SHALL update the
14
+ status to active. This test verifies that the incoming handshake request is a conformant
15
15
  [R4 Topic-Based Subscription Notification Bundle](https://hl7.org/fhir/uv/subscriptions-backport/STU1.1/StructureDefinition-backport-subscription-notification-r4.html).
16
16
  )
17
17
 
@@ -41,9 +41,10 @@ module SubscriptionsTestKit
41
41
 
42
42
  requests = load_tagged_requests('handshake')
43
43
  if requests.empty?
44
- omit_if subscription_request_ids.empty?, 'No handshake requests were required or received in a previous tests.'
44
+ omit_if subscription_request_ids.empty?,
45
+ 'No handshake requests were required or received in a previous tests.'
45
46
  assert(subscription_request_ids.empty?,
46
- 'Handshake requests are required if a Subscription channel type is `rest-hook`')
47
+ 'Handshake requests are required if a Subscription channel type is `rest-hook`')
47
48
  end
48
49
 
49
50
  requests = requests.uniq(&:request_body)
@@ -60,7 +61,7 @@ module SubscriptionsTestKit
60
61
 
61
62
  no_error_verification('Received handshakes are not conformant.')
62
63
  assert(subscription_request_ids.empty?,
63
- 'Did not receive a handshake notification for some `rest-hook` subscriptions')
64
+ 'Did not receive a handshake notification for some `rest-hook` subscriptions')
64
65
  end
65
66
  end
66
67
  end
@@ -26,7 +26,9 @@ module SubscriptionsTestKit
26
26
  def heartbeat_period?(subscription_extensions)
27
27
  return false if subscription_extensions.blank?
28
28
 
29
- heartbeat = subscription_extensions.find { |extension| extension['url'].ends_with?('/backport-heartbeat-period') }
29
+ heartbeat = subscription_extensions.find do |extension|
30
+ extension['url'].ends_with?('/backport-heartbeat-period')
31
+ end
30
32
 
31
33
  return false if heartbeat.blank?
32
34
 
@@ -63,7 +65,7 @@ module SubscriptionsTestKit
63
65
  subscription_id = tags.first
64
66
 
65
67
  assert(subscription_request_ids.include?(subscription_id),
66
- 'If `heartbeatPeriod` field is not present in the Subscription, heartbeat should not be sent.')
68
+ 'If `heartbeatPeriod` field is not present in the Subscription, heartbeat should not be sent.')
67
69
 
68
70
  notification_verification(request.request_body, 'heartbeat', subscription_id:)
69
71
  no_error_verification('Received heartbeats are not conformant.')
@@ -14,8 +14,8 @@ module SubscriptionsTestKit
14
14
  resources, one per Subscription being queried. The Bundle type is "searchset". The status of the Subscription
15
15
  should be set to 'active' after a successful handshake with the rest-hook endpoint.
16
16
 
17
- This test ensures the server supports the $status operation by performing the operation and ensuring it receives a
18
- valid response.
17
+ This test ensures the server supports the $status operation by performing the operation and ensuring it receives
18
+ a valid response.
19
19
  )
20
20
 
21
21
  verifies_requirements 'hl7.fhir.uv.subscriptions_1.1.0@20',
@@ -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
@@ -8,10 +8,10 @@ module SubscriptionsTestKit
8
8
  id :subscriptions_r4_server_reject_subscriptions
9
9
  title 'Server Handles Unsupported Subscriptions'
10
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:
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. This test checks
14
+ that the server correctly rejects or adjusts the Subscription in the following cases:
15
15
 
16
16
  - The Subscription contains cross-version extension
17
17
  - The Subscription contains a Subscription Topic not implemented by the server
@@ -21,7 +21,7 @@ module SubscriptionsTestKit
21
21
  - The Subscription contains a payload type not implemented by the server
22
22
  - The Subscription contains an unsupported channel and payload type combination
23
23
 
24
- The test will pass if the server either
24
+ The test will pass if the server either
25
25
  1. rejects the Subscription by responding with a non-201 response, or
26
26
  2. updates the Subscription resource to remove or replace the unsupported value.
27
27
  )
@@ -41,20 +41,23 @@ module SubscriptionsTestKit
41
41
  so that it can demonstrate its ability to perform the Subscription creation and Notification
42
42
  response workflow. The instance must be conformant to the R4/B Topic-Based Subscription profile.
43
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.
44
+ This input is also used by the unsupported Subscription test as the base on which to add unsupported
45
+ element values to test for server rejection.
46
46
  )
47
47
  input :unsupported_subscription_topic,
48
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.',
49
+ description: %(A Subscription Topic for the `criteria` element that is not implemented by the server to test
50
+ for Subscription rejection.),
50
51
  optional: true
51
52
  input :unsupported_subscription_filter,
52
53
  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
+ description: %(A value for `filterCriteria` extension under the `criteria` that is not implemented by the
55
+ server to test for Subscription rejection.),
54
56
  optional: true
55
57
  input :unsupported_subscription_channel_type,
56
58
  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.',
59
+ description: %(A value for the `channel.type` element that is not implemented by the server to test for
60
+ Subscription rejection.),
58
61
  optional: true
59
62
  input :unsupported_subscription_channel_endpoint,
60
63
  title: 'Unsupported Subscription Channel Endpoint',
@@ -62,12 +65,13 @@ module SubscriptionsTestKit
62
65
  optional: true
63
66
  input :unsupported_subscription_payload_type,
64
67
  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.',
68
+ description: %(A value for the `content` extension under the `channel.payload` element that is not
69
+ implemented by the server to test for Subscription rejection.),
66
70
  optional: true
67
71
  input :unsupported_subscription_channel_payload_combo,
68
72
  title: 'Unsupported Subscription Channel and Payload Combination',
69
73
  description: %(
70
- A channel (`channel.type`) and payload type (`content` extension under the `channel.payload` element)
74
+ A channel (`channel.type`) and payload type (`content` extension under the `channel.payload` element)
71
75
  combination not implemented by the server to test for Subscription
72
76
  rejection. Provide in the json format e.g. {channel: <'channel_type'>, payload: <'payload_type'>}.
73
77
  ),
@@ -92,13 +96,13 @@ module SubscriptionsTestKit
92
96
  'unsupported_title' => 'unsupported filter criteria',
93
97
  'field_path' => ['_criteria'],
94
98
  '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
99
+ unsupported_subscription_filter
100
+ else
101
+ { 'extension' => [{
102
+ url: 'http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-filter-criteria',
103
+ valueString: unsupported_subscription_filter
104
+ }] }
105
+ end
102
106
  },
103
107
  {
104
108
  'unsupported_title' => 'unsupported channel type',
@@ -142,8 +146,8 @@ module SubscriptionsTestKit
142
146
  original_field_value = subscription_field[field_name]
143
147
  subscription_field[field_name] = unsupported_info['field_value']
144
148
 
145
- send_unsupported_subscription(subscription, unsupported_info['unsupported_title'], [unsupported_info['field_path']],
146
- [unsupported_info['field_value']])
149
+ send_unsupported_subscription(subscription, unsupported_info['unsupported_title'],
150
+ [unsupported_info['field_path']], [unsupported_info['field_value']])
147
151
 
148
152
  if original_field_value.nil?
149
153
  subscription_field.delete(field_name)
@@ -159,8 +163,8 @@ module SubscriptionsTestKit
159
163
  payload_value = channel_payload_combo['payload']
160
164
 
161
165
  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.))
166
+ add_message('error', %(Channel and payload values are not populated correctly in unsupported channel and
167
+ payload combination input.))
164
168
  else
165
169
  subscription_channel = subscription['channel']
166
170
  subscription_channel['type'] = channel_value
@@ -169,8 +173,8 @@ module SubscriptionsTestKit
169
173
  channel_path = ['channel', 'type']
170
174
  payload_path = ['channel', 'payload']
171
175
 
172
- send_unsupported_subscription(subscription, 'unsupported channel and payload combination', [channel_path, payload_path],
173
- [channel_value, payload_value])
176
+ send_unsupported_subscription(subscription, 'unsupported channel and payload combination',
177
+ [channel_path, payload_path], [channel_value, payload_value])
174
178
  end
175
179
  end
176
180
 
@@ -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.3'.freeze
5
3
  end