Class: SMARTAppLaunch::SMARTAccessBrandsValidateBrands

Inherits:
Inferno::Test
  • Object
show all
Defined in:
lib/smart_app_launch/smart_access_brands_validate_brands_test.rb

Instance Method Summary collapse

Instance Method Details

#check_portal_endpoints(portal_endpoints, organization_endpoints) ⇒ Object



40
41
42
43
44
45
46
47
48
49
# File 'lib/smart_app_launch/smart_access_brands_validate_brands_test.rb', line 40

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



34
35
36
37
38
# File 'lib/smart_app_launch/smart_access_brands_validate_brands_test.rb', line 34

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



28
29
30
31
32
# File 'lib/smart_app_launch/smart_access_brands_validate_brands_test.rb', line 28

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



19
20
21
22
23
24
25
26
# File 'lib/smart_app_launch/smart_access_brands_validate_brands_test.rb', line 19

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_messageObject



51
52
53
54
55
56
57
# File 'lib/smart_app_launch/smart_access_brands_validate_brands_test.rb', line 51

def skip_message
  %(
    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