Class: SMARTAppLaunch::SMARTAccessBrandsValidateBrands
- Inherits:
-
Inferno::Test
- Object
- Inferno::Test
- SMARTAppLaunch::SMARTAccessBrandsValidateBrands
- Defined in:
- lib/smart_app_launch/smart_access_brands_validate_brands_test.rb
Instance Method Summary collapse
- #check_portal_endpoints(portal_endpoints, organization_endpoints) ⇒ Object
- #find_all_extensions(extension_array, extension_name) ⇒ Object
- #find_extension(extension_array, extension_name) ⇒ Object
- #find_referenced_endpoint(bundle_resource, endpoint_id_ref) ⇒ Object
- #skip_message ⇒ Object
Instance Method Details
#check_portal_endpoints(portal_endpoints, organization_endpoints) ⇒ Object
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/smart_app_launch/smart_access_brands_validate_brands_test.rb', line 42 def check_portal_endpoints(portal_endpoints, organization_endpoints) portal_endpoints.each do |portal_endpoint| portal_endpoint_found = organization_endpoints.any? do |endpoint_reference| portal_endpoint.valueReference.reference == endpoint_reference end assert(portal_endpoint_found, %( Portal endpoints must also appear at Organization.endpoint. The portal endpoint with reference #{portal_endpoint.valueReference.reference} was not found at Organization.endpoint.)) end end |
#find_all_extensions(extension_array, extension_name) ⇒ Object
36 37 38 39 40 |
# File 'lib/smart_app_launch/smart_access_brands_validate_brands_test.rb', line 36 def find_all_extensions(extension_array, extension_name) extension_array.select do |extension| extension.url == extension_name end end |
#find_extension(extension_array, extension_name) ⇒ Object
30 31 32 33 34 |
# File 'lib/smart_app_launch/smart_access_brands_validate_brands_test.rb', line 30 def find_extension(extension_array, extension_name) extension_array.find do |extension| extension.url.ends_with?(extension_name) end end |
#find_referenced_endpoint(bundle_resource, endpoint_id_ref) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/smart_app_launch/smart_access_brands_validate_brands_test.rb', line 21 def find_referenced_endpoint(bundle_resource, endpoint_id_ref) bundle_resource .entry .map(&:resource) .select { |resource| resource.resourceType == 'Endpoint' } .map(&:id) .select { |endpoint_id| endpoint_id_ref.include? endpoint_id } end |
#skip_message ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/smart_app_launch/smart_access_brands_validate_brands_test.rb', line 53 def %( No User Access Brands request was made in the previous test, and no User Access Brands Bundle was provided as input instead. Either provide a User Access Brands Publication URL to retrieve the Bundle via a HTTP GET request, or provide the Bundle as an input. ) end |