Class: DaVinciPDexTestKit::PDexPayerClient::MockServer::ProxyEndpoint Abstract
- Inherits:
-
Inferno::DSL::SuiteEndpoint
- Object
- Inferno::DSL::SuiteEndpoint
- DaVinciPDexTestKit::PDexPayerClient::MockServer::ProxyEndpoint
- Includes:
- URLs
- Defined in:
- lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/proxy_endpoint.rb
Overview
This class defines
-
a Faraday connection for proxying requests to ENV
-
common methods and conventions for PDex Client Testing endpoints
Direct Known Subclasses
BinaryEndpoint, ExportEndpoint, ExportStatusEndpoint, MemberMatchEndpoint, NextPageEndpoint, PatientEndpoint, PatientEverythingEndpoint, ResourceReadEndpoint, ResourceSearchEndpoint
Constant Summary
Constants included from URLs
URLs::AUTHORIZATION_PATH, URLs::BASE_FHIR_PATH, URLs::BINARY_PATH, URLs::EVERYTHING_PATH, URLs::EXPORT_PATH, URLs::EXPORT_STATUS_PATH, URLs::INSTANCE_PATH, URLs::MEMBER_MATCH_PATH, URLs::METADATA_PATH, URLs::PATIENT_INSTANCE_PATH, URLs::PATIENT_PATH, URLs::RESOURCE_PATH, URLs::RESUME_CLINICAL_DATA_PATH, URLs::RESUME_FAIL_PATH, URLs::RESUME_PASS_PATH, URLs::TOKEN_PATH
Instance Method Summary collapse
- #make_response ⇒ Object
-
#server_proxy ⇒ Faraday
REST Client that proxies request to server at ‘ENV`.
- #test_run_identifier ⇒ Object
- #update_result ⇒ Object
Methods included from URLs
#base_url, #client_fhir_base_url, #fhir_base_url, #suite_id
Instance Method Details
#make_response ⇒ Object
26 27 28 29 |
# File 'lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/proxy_endpoint.rb', line 26 def make_response server_response = proxy_request(request) proxy_response(server_response) end |
#server_proxy ⇒ Faraday
REST Client that proxies request to server at ‘ENV`
40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/proxy_endpoint.rb', line 40 def server_proxy @server_proxy ||= Faraday.new( url: fhir_reference_server, params: {}, headers: { 'Accept' => 'application/fhir+json,application/json', 'Accept-Encoding' => 'identity', 'Authorization' => 'Bearer SAMPLE_TOKEN', 'Host' => ENV.fetch('HOST_HEADER') } ) do |proxy| proxy.use Faraday::Response::Logger end end |
#test_run_identifier ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/proxy_endpoint.rb', line 18 def test_run_identifier return request.params[:session_path] if request.params[:session_path].present? SMARTAppLaunch::MockSMARTServer.issued_token_to_client_id( request.headers['authorization']&.delete_prefix('Bearer ') ) end |
#update_result ⇒ Object
31 32 33 |
# File 'lib/davinci_pdex_test_kit/pdex_payer_client/mock_server/proxy_endpoint.rb', line 31 def update_result results_repo.update(result.id, result: 'pass') unless test.config.[:accepts_multiple_requests] end |