subscriptions_test_kit 0.9.1 → 0.9.3
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 +4 -2
- data/lib/subscriptions_test_kit/endpoints/subscription_create_endpoint.rb +7 -3
- data/lib/subscriptions_test_kit/endpoints/subscription_status_endpoint.rb +16 -11
- data/lib/subscriptions_test_kit/requirements/generated/subscriptions-test-kit_requirements_coverage.csv +50 -50
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/common/subscription_simulation_utils.rb +9 -6
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification/notification_input_payload_verification_test.rb +3 -3
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification/notification_input_verification_test.rb +2 -2
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification/processing_attestation_test.rb +2 -2
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification/subscription_verification_test.rb +3 -3
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/conformance_verification_group.rb +6 -6
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/interaction_test.rb +15 -12
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/interaction_verification/event_notification_verification_test.rb +7 -6
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/interaction_verification/handshake_notification_verification_test.rb +6 -6
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow/interaction_verification_group.rb +4 -4
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow_group.rb +4 -4
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client_suite.rb +6 -4
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/{coverage/capability_statement → capability_statement}/cs_conformance_test.rb +2 -2
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/{coverage/capability_statement → capability_statement}/topic_discovery_test.rb +5 -5
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/capability_statement_group.rb +21 -0
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/interaction/creation_response_conformance_test.rb +2 -2
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/interaction/notification_delivery_test.rb +1 -1
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/interaction/subscription_conformance_test.rb +11 -10
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/interaction_group.rb +7 -7
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/interaction_verification/notification_conformance_test.rb +1 -1
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/common/interaction_verification_group.rb +2 -2
- 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/{coverage/event_notification → event_notification}/empty_content/empty_conformance_test.rb +2 -2
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/{coverage/event_notification → event_notification}/empty_content_group.rb +11 -10
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/{coverage/event_notification → event_notification}/full_resource_content/full_resource_conformance_test.rb +4 -4
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/{coverage/event_notification → event_notification}/full_resource_content_group.rb +11 -10
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/{coverage/event_notification → event_notification}/id_only_content/id_only_conformance_test.rb +4 -4
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/{coverage/event_notification → event_notification}/id_only_content_group.rb +11 -10
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/{coverage/event_notification_group.rb → event_notification_group.rb} +6 -6
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/{coverage/handshake_heartbeat → handshake_heartbeat}/handshake_conformance_test.rb +9 -8
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/{coverage/handshake_heartbeat → handshake_heartbeat}/heartbeat_conformance_test.rb +6 -4
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/{coverage/handshake_heartbeat_group.rb → handshake_heartbeat_group.rb} +3 -3
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/{coverage/status_operation → status_operation}/status_invocation_test.rb +4 -4
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/{coverage/status_operation_group.rb → status_operation_group.rb} +3 -3
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/{coverage/subscription_rejection → subscription_rejection}/reject_subscriptions_test.rb +31 -27
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/{coverage/subscription_rejection_group.rb → subscription_rejection_group.rb} +2 -2
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/workflow_group.rb +3 -3
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server_suite.rb +14 -5
- data/lib/subscriptions_test_kit/version.rb +1 -3
- metadata +21 -92
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/coverage/capability_statement_group.rb +0 -21
- data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_server/coverage_group.rb +0 -26
@@ -8,13 +8,13 @@ require_relative 'conformance_verification/processing_attestation_test'
|
|
8
8
|
module SubscriptionsTestKit
|
9
9
|
module SubscriptionsR5BackportR4Client
|
10
10
|
class ConformanceVerificationGroup < Inferno::TestGroup
|
11
|
-
id :
|
11
|
+
id :subscriptions_r4_client_conformance_verification
|
12
12
|
title 'Rest-Hook Subscription Conformance Verification'
|
13
13
|
|
14
|
-
test from: :
|
15
|
-
test from: :
|
16
|
-
test from: :
|
17
|
-
test from: :
|
14
|
+
test from: :subscriptions_r4_client_subscription_verification
|
15
|
+
test from: :subscriptions_r4_client_notification_input_verification
|
16
|
+
test from: :subscriptions_r4_client_notification_input_payload_verification
|
17
|
+
test from: :subscriptions_r4_client_processing_attestation
|
18
18
|
end
|
19
19
|
end
|
20
|
-
end
|
20
|
+
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module SubscriptionsTestKit
|
4
4
|
module SubscriptionsR5BackportR4Client
|
5
5
|
class InteractionTest < Inferno::Test
|
6
|
-
id :
|
6
|
+
id :subscriptions_r4_client_interaction
|
7
7
|
description %(
|
8
8
|
During this test, the client under test will interact with Inferno following the Subscription
|
9
9
|
workflow over a `rest-hook` channel. This includes the following steps
|
@@ -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
|
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
|
53
|
-
needed if the client under test will create a Subscription with an appropriate header value
|
54
|
-
`channel.header` element. If a value for the `authorization` header is provided in
|
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?
|
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
|
@@ -7,7 +7,7 @@ module SubscriptionsTestKit
|
|
7
7
|
class EventNotificationVerificationTest < Inferno::Test
|
8
8
|
include SubscriptionSimulationUtils
|
9
9
|
|
10
|
-
id :
|
10
|
+
id :subscriptions_r4_client_event_notification_verification
|
11
11
|
title 'Rest-Hook Event Notification Verification'
|
12
12
|
description %(
|
13
13
|
This test verifies that the client's response to the event notification
|
@@ -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),
|
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
|
33
|
-
|
34
|
-
|
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
|
@@ -7,7 +7,7 @@ module SubscriptionsTestKit
|
|
7
7
|
class HandshakeNotificationVerificationTest < Inferno::Test
|
8
8
|
include SubscriptionSimulationUtils
|
9
9
|
|
10
|
-
id :
|
10
|
+
id :subscriptions_r4_client_handshake_notification_verification
|
11
11
|
title 'Rest-Hook Handshake Notification Verification'
|
12
12
|
description %(
|
13
13
|
This test verifies that the client's response to the handshake notification
|
@@ -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
|
-
|
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
|
33
|
-
|
34
|
-
|
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
|
@@ -6,11 +6,11 @@ require_relative 'interaction_verification/event_notification_verification_test'
|
|
6
6
|
module SubscriptionsTestKit
|
7
7
|
module SubscriptionsR5BackportR4Client
|
8
8
|
class InteractionVerificationGroup < Inferno::TestGroup
|
9
|
-
id :
|
9
|
+
id :subscriptions_r4_client_interaction_verification
|
10
10
|
title 'Rest-Hook Subscription Interaction Verification'
|
11
11
|
|
12
|
-
test from: :
|
13
|
-
test from: :
|
12
|
+
test from: :subscriptions_r4_client_handshake_notification_verification
|
13
|
+
test from: :subscriptions_r4_client_event_notification_verification
|
14
14
|
end
|
15
15
|
end
|
16
|
-
end
|
16
|
+
end
|
data/lib/subscriptions_test_kit/suites/subscriptions_r5_backport_r4_client/workflow_group.rb
CHANGED
@@ -9,7 +9,7 @@ module SubscriptionsTestKit
|
|
9
9
|
class WorkflowGroup < Inferno::TestGroup
|
10
10
|
include URLs
|
11
11
|
|
12
|
-
id :
|
12
|
+
id :subscriptions_r4_client_workflow
|
13
13
|
title 'Demonstrate the Rest-Hook Subscription Workflow'
|
14
14
|
description %(
|
15
15
|
Demonstrate the ability of the client to request the
|
@@ -23,11 +23,11 @@ module SubscriptionsTestKit
|
|
23
23
|
run_as_group
|
24
24
|
|
25
25
|
group 'Rest-Hook Subscription Interaction' do
|
26
|
-
test from: :
|
26
|
+
test from: :subscriptions_r4_client_interaction
|
27
27
|
end
|
28
28
|
|
29
|
-
group from: :
|
30
|
-
group from: :
|
29
|
+
group from: :subscriptions_r4_client_interaction_verification
|
30
|
+
group from: :subscriptions_r4_client_conformance_verification
|
31
31
|
end
|
32
32
|
end
|
33
33
|
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',
|
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',
|
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
|
@@ -60,7 +62,7 @@ module SubscriptionsTestKit
|
|
60
62
|
request.query_parameters['test_run_identifier']
|
61
63
|
end
|
62
64
|
|
63
|
-
group from: :
|
65
|
+
group from: :subscriptions_r4_client_workflow
|
64
66
|
end
|
65
67
|
end
|
66
|
-
end
|
68
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module SubscriptionsTestKit
|
2
2
|
module SubscriptionsR5BackportR4Server
|
3
3
|
class CSConformanceTest < Inferno::Test
|
4
|
-
id :
|
4
|
+
id :subscriptions_r4_server_cs_conformance
|
5
5
|
title 'Capability Statement Conformance Verification'
|
6
6
|
description %(
|
7
7
|
This test attempts to retreive the server's Capability Statement in order to verify that it
|
@@ -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
|
-
|
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
|
@@ -1,11 +1,11 @@
|
|
1
|
-
require_relative '
|
1
|
+
require_relative '../../../common/subscription_conformance_verification'
|
2
2
|
|
3
3
|
module SubscriptionsTestKit
|
4
4
|
module SubscriptionsR5BackportR4Server
|
5
5
|
class TopicDiscoveryTest < Inferno::Test
|
6
6
|
include SubscriptionConformanceVerification
|
7
7
|
|
8
|
-
id :
|
8
|
+
id :subscriptions_r4_server_topic_discovery
|
9
9
|
title 'Attempt topic discovery'
|
10
10
|
description %(
|
11
11
|
This test attempts to perform topic discovery with the server. In order to allow for [discovery of supported
|
@@ -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
|
-
|
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
|
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
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require_relative 'capability_statement/cs_conformance_test'
|
2
|
+
require_relative 'capability_statement/topic_discovery_test'
|
3
|
+
|
4
|
+
module SubscriptionsTestKit
|
5
|
+
module SubscriptionsR5BackportR4Server
|
6
|
+
class CapabilityStatementGroup < Inferno::TestGroup
|
7
|
+
id :subscriptions_r4_server_capability_statement
|
8
|
+
title 'Capability Statement Verification'
|
9
|
+
description %(
|
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
|
+
)
|
14
|
+
|
15
|
+
run_as_group
|
16
|
+
|
17
|
+
test from: :subscriptions_r4_server_cs_conformance
|
18
|
+
test from: :subscriptions_r4_server_topic_discovery
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module SubscriptionsTestKit
|
2
2
|
module SubscriptionsR5BackportR4Server
|
3
3
|
class CreationResponseConformanceTest < Inferno::Test
|
4
|
-
id :
|
4
|
+
id :subscriptions_r4_server_creation_response_conformance
|
5
5
|
title 'Verify Subscription Creation Response'
|
6
6
|
description %(
|
7
7
|
This test ensures that the server responded to the Subscription creation test with the new created Subscription
|
@@ -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
|
-
|
46
|
+
"The Subscription resource should have it's status set to 'requested', was '#{subscription.status}'")
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
@@ -7,7 +7,7 @@ module SubscriptionsTestKit
|
|
7
7
|
include SubscriptionCreation
|
8
8
|
include URLs
|
9
9
|
|
10
|
-
id :
|
10
|
+
id :subscriptions_r4_server_notification_delivery
|
11
11
|
title 'Send Subscription and Receive Notification Requests from Server'
|
12
12
|
description %(
|
13
13
|
This test sends a request to create the Subscription resource to the Subscriptions Backport FHIR Server.
|
@@ -5,27 +5,28 @@ module SubscriptionsTestKit
|
|
5
5
|
class SubscriptionConformanceTest < Inferno::Test
|
6
6
|
include SubscriptionConformanceVerification
|
7
7
|
|
8
|
-
id :
|
8
|
+
id :subscriptions_r4_server_subscription_conformance
|
9
9
|
title '[USER INPUT VERIFICATION] Verify Subscription to Send to Server'
|
10
10
|
description %(
|
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
|
15
|
-
be found on the
|
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
|
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
|
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
|
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
|
-
|
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)
|
@@ -5,20 +5,20 @@ require_relative 'interaction/creation_response_conformance_test'
|
|
5
5
|
module SubscriptionsTestKit
|
6
6
|
module SubscriptionsR5BackportR4Server
|
7
7
|
class InteractionGroup < Inferno::TestGroup
|
8
|
-
id :
|
8
|
+
id :subscriptions_r4_server_interaction
|
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
|
13
|
-
for that Subscription. Inferno will act as a client, creating the Subscription and waiting for a
|
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
|
18
18
|
|
19
|
-
test from: :
|
20
|
-
test from: :
|
21
|
-
test from: :
|
19
|
+
test from: :subscriptions_r4_server_subscription_conformance
|
20
|
+
test from: :subscriptions_r4_server_notification_delivery
|
21
|
+
test from: :subscriptions_r4_server_creation_response_conformance
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -5,7 +5,7 @@ module SubscriptionsTestKit
|
|
5
5
|
class NotificationConformanceTest < Inferno::Test
|
6
6
|
include NotificationConformanceVerification
|
7
7
|
|
8
|
-
id :
|
8
|
+
id :subscriptions_r4_server_notification_conformance
|
9
9
|
title 'Subscription Notification Verification'
|
10
10
|
description %(
|
11
11
|
As described in [Topic-Based Subscription Components](https://hl7.org/fhir/uv/subscriptions-backport/STU1.1/components.html#subscription-notifications),
|
@@ -3,7 +3,7 @@ require_relative 'interaction_verification/notification_conformance_test'
|
|
3
3
|
module SubscriptionsTestKit
|
4
4
|
module SubscriptionsR5BackportR4Server
|
5
5
|
class InteractionVerificationGroup < Inferno::TestGroup
|
6
|
-
id :
|
6
|
+
id :subscriptions_r4_server_interaction_verification
|
7
7
|
title 'Subscription Workflow Interaction Verification'
|
8
8
|
description %(
|
9
9
|
Inferno takes the received event-notification Bundle and verifies that it is conformant to the
|
@@ -13,7 +13,7 @@ module SubscriptionsTestKit
|
|
13
13
|
|
14
14
|
run_as_group
|
15
15
|
|
16
|
-
test from: :
|
16
|
+
test from: :subscriptions_r4_server_notification_conformance
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -17,7 +17,8 @@ module SubscriptionsTestKit
|
|
17
17
|
assert_resource_type('Bundle')
|
18
18
|
|
19
19
|
unless resource.type == 'searchset'
|
20
|
-
add_message('error',
|
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
|
-
|
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,
|
@@ -1,11 +1,11 @@
|
|
1
|
-
require_relative '
|
1
|
+
require_relative '../../../../common/notification_conformance_verification'
|
2
2
|
|
3
3
|
module SubscriptionsTestKit
|
4
4
|
module SubscriptionsR5BackportR4Server
|
5
5
|
class EmptyConformanceTest < Inferno::Test
|
6
6
|
include NotificationConformanceVerification
|
7
7
|
|
8
|
-
id :
|
8
|
+
id :subscriptions_r4_server_empty_conformance
|
9
9
|
title 'Subscription Empty Notification Verification'
|
10
10
|
description %(
|
11
11
|
This test takes the received empty notification bundle and ensures it is conformant to the
|
@@ -1,11 +1,11 @@
|
|
1
|
-
require_relative '
|
2
|
-
require_relative '
|
1
|
+
require_relative '../common/interaction_group'
|
2
|
+
require_relative '../common/interaction_verification_group'
|
3
3
|
require_relative 'empty_content/empty_conformance_test'
|
4
4
|
|
5
5
|
module SubscriptionsTestKit
|
6
6
|
module SubscriptionsR5BackportR4Server
|
7
7
|
class EmptyContentGroup < Inferno::TestGroup
|
8
|
-
id :
|
8
|
+
id :subscriptions_r4_server_empty_content
|
9
9
|
title 'Empty Notification Verification'
|
10
10
|
description %(
|
11
11
|
Verify that the received Notifications are conformant to the
|
@@ -18,8 +18,8 @@ module SubscriptionsTestKit
|
|
18
18
|
|
19
19
|
input_order :url, :credentials, :access_token, :empty_subscription_resource
|
20
20
|
|
21
|
-
group from: :
|
22
|
-
id :
|
21
|
+
group from: :subscriptions_r4_server_interaction do
|
22
|
+
id :subscriptions_r4_server_empty_content_interaction
|
23
23
|
optional
|
24
24
|
|
25
25
|
config(
|
@@ -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
|
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
|
},
|
@@ -44,14 +45,14 @@ module SubscriptionsTestKit
|
|
44
45
|
}
|
45
46
|
)
|
46
47
|
end
|
47
|
-
group from: :
|
48
|
-
id :
|
48
|
+
group from: :subscriptions_r4_server_interaction_verification do
|
49
|
+
id :subscriptions_r4_server_empty_content_interaction_verification
|
49
50
|
optional
|
50
51
|
|
51
52
|
config(
|
52
53
|
options: { subscription_type: 'empty' }
|
53
54
|
)
|
54
|
-
test from: :
|
55
|
+
test from: :subscriptions_r4_server_empty_conformance
|
55
56
|
end
|
56
57
|
end
|
57
58
|
end
|
@@ -1,19 +1,19 @@
|
|
1
|
-
require_relative '
|
1
|
+
require_relative '../../../../common/notification_conformance_verification'
|
2
2
|
|
3
3
|
module SubscriptionsTestKit
|
4
4
|
module SubscriptionsR5BackportR4Server
|
5
5
|
class FullResourceConformanceTest < Inferno::Test
|
6
6
|
include NotificationConformanceVerification
|
7
7
|
|
8
|
-
id :
|
8
|
+
id :subscriptions_r4_server_full_resource_conformance
|
9
9
|
title 'Subscription Full-Resource Notification Verification'
|
10
10
|
description %(
|
11
11
|
This test takes the received notification bundle and ensures it is 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
13
|
profle.
|
14
14
|
|
15
|
-
With the content type of full-resource, the resources involved in triggering the notification are included in
|
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.
|
@@ -1,11 +1,11 @@
|
|
1
|
-
require_relative '
|
2
|
-
require_relative '
|
1
|
+
require_relative '../common/interaction_group'
|
2
|
+
require_relative '../common/interaction_verification_group'
|
3
3
|
require_relative 'full_resource_content/full_resource_conformance_test'
|
4
4
|
|
5
5
|
module SubscriptionsTestKit
|
6
6
|
module SubscriptionsR5BackportR4Server
|
7
7
|
class FullResourceContentGroup < Inferno::TestGroup
|
8
|
-
id :
|
8
|
+
id :subscriptions_r4_server_full_resource_content
|
9
9
|
title 'Full Resource Notification Verification'
|
10
10
|
description %(
|
11
11
|
Verify that the received Notifications are conformant to the
|
@@ -18,8 +18,8 @@ module SubscriptionsTestKit
|
|
18
18
|
|
19
19
|
input_order :url, :credentials, :access_token, :full_resource_subscription_resource
|
20
20
|
|
21
|
-
group from: :
|
22
|
-
id :
|
21
|
+
group from: :subscriptions_r4_server_interaction do
|
22
|
+
id :subscriptions_r4_server_full_resource_content_interaction
|
23
23
|
optional
|
24
24
|
|
25
25
|
config(
|
@@ -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
|
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
|
},
|
@@ -44,14 +45,14 @@ module SubscriptionsTestKit
|
|
44
45
|
}
|
45
46
|
)
|
46
47
|
end
|
47
|
-
group from: :
|
48
|
-
id :
|
48
|
+
group from: :subscriptions_r4_server_interaction_verification do
|
49
|
+
id :subscriptions_r4_server_full_resource_content_interaction_verification
|
49
50
|
optional
|
50
51
|
|
51
52
|
config(
|
52
53
|
options: { subscription_type: 'full-resource' }
|
53
54
|
)
|
54
|
-
test from: :
|
55
|
+
test from: :subscriptions_r4_server_full_resource_conformance
|
55
56
|
end
|
56
57
|
end
|
57
58
|
end
|