Class: DaVinciCRDTestKit::V221::ClientPrefetchCompleteAndSubsetTest

Inherits:
Inferno::Test
  • Object
show all
Includes:
CrossHookHelper, TaggedRequestLoadHelper
Defined in:
lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_prefetch_complete_and_subset_test.rb

Instance Method Summary collapse

Methods included from CrossHookHelper

#find_completeness_tests

Methods included from TaggedRequestLoadHelper

#crd_interaction_group, #hook_name, #load_interaction_group_requests, #load_requests_for_cross_hook_analysis

Instance Method Details

#check_for_demonstration(requests, completeness_tests, target_name) ⇒ Object



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/davinci_crd_test_kit/client/v2.2.1/cross_hook/client_prefetch_complete_and_subset_test.rb', line 64

def check_for_demonstration(requests, completeness_tests, target_name)
  unless requests.present?
    add_message('error', "No requests made to the service endpoint requesting #{target_name} prefetch data.")
    return
  end

  results_repo = Inferno::Repositories::Results.new
  results = results_repo.current_results_for_test_session_and_runnables(test_session_id,
                                                                        completeness_tests)
  output_name =
    if target_name == :subset
      'demonstrates_prefetch_subset_distinct_from_complete'
    else
      'demonstrates_prefetch_complete_distinct_from_subset'
    end

  demonstrated = results.any? do |result|
    result.outputs.any? do |output|
      output['name'] == output_name &&
        output['value'] == 'true'
    end
  end

  return if demonstrated

  add_message('error', "Requests made to the service endpoint requesting #{target_name} prefetch data " \
                       'did not demonstrate a difference between the two levels of prefetch data.')
end