From 3ab31c2b646ace7aae60e68ceb63ba5bd897d8d5 Mon Sep 17 00:00:00 2001 From: Kyle Soskin <37049625+kylesoskin@users.noreply.github.com> Date: Tue, 7 Feb 2023 09:51:19 -0500 Subject: [PATCH] Moving around (#11733) --- .../non_breakered_configuration.rb | 22 +++++++++++++++++++ .../non_breakered_service.rb | 3 ++- lib/evss/non_breakered_configuration.rb | 20 ----------------- .../processor.rb | 1 + 4 files changed, 25 insertions(+), 21 deletions(-) create mode 100644 lib/evss/disability_compensation_form/non_breakered_configuration.rb delete mode 100644 lib/evss/non_breakered_configuration.rb diff --git a/lib/evss/disability_compensation_form/non_breakered_configuration.rb b/lib/evss/disability_compensation_form/non_breakered_configuration.rb new file mode 100644 index 00000000000..3310e5edaf9 --- /dev/null +++ b/lib/evss/disability_compensation_form/non_breakered_configuration.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require 'evss/configuration' + +module EVSS + module DisabilityCompensationForm + class NonBreakeredConfiguration < EVSS::DisabilityCompensationForm::Configuration + def set_evss_middlewares(faraday, snakecase: true) + # faraday.use :breakers # DONT USE BREAKERS + faraday.use EVSS::ErrorMiddleware + faraday.use Faraday::Response::RaiseError + faraday.response :betamocks if mock_enabled? + faraday.response :snakecase, symbolize: false if snakecase + # calls to EVSS returns non JSON responses for some scenarios that don't make it through VAAFI + # content_type: /\bjson$/ ensures only json content types are attempted to be parsed. + faraday.response :json, content_type: /\bjson$/ + faraday.use :immutable_headers + faraday.adapter Faraday.default_adapter + end + end + end +end diff --git a/lib/evss/disability_compensation_form/non_breakered_service.rb b/lib/evss/disability_compensation_form/non_breakered_service.rb index 6d33aad57a0..c65b5aa9926 100644 --- a/lib/evss/disability_compensation_form/non_breakered_service.rb +++ b/lib/evss/disability_compensation_form/non_breakered_service.rb @@ -3,6 +3,7 @@ require 'common/client/concerns/monitoring' require 'common/client/errors' require 'evss/service' +require 'evss/disability_compensation_form/non_breakered_configuration' require 'evss/disability_compensation_auth_headers' require_relative 'configuration' require_relative 'rated_disabilities_response' @@ -12,7 +13,7 @@ module EVSS module DisabilityCompensationForm class NonBreakeredService < EVSS::DisabilityCompensationForm::Service - configuration EVSS::NonBreakeredConfiguration + configuration EVSS::DisabilityCompensationForm::NonBreakeredConfiguration end end end diff --git a/lib/evss/non_breakered_configuration.rb b/lib/evss/non_breakered_configuration.rb deleted file mode 100644 index ff250a3ba38..00000000000 --- a/lib/evss/non_breakered_configuration.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -require 'common/client/configuration/rest' - -module EVSS - class NonBreakeredConfiguration < EVSS::Configuration - def set_evss_middlewares(faraday, snakecase: true) - # faraday.use :breakers # DONT USE BREAKERS - faraday.use EVSS::ErrorMiddleware - faraday.use Faraday::Response::RaiseError - faraday.response :betamocks if mock_enabled? - faraday.response :snakecase, symbolize: false if snakecase - # calls to EVSS returns non JSON responses for some scenarios that don't make it through VAAFI - # content_type: /\bjson$/ ensures only json content types are attempted to be parsed. - faraday.response :json, content_type: /\bjson$/ - faraday.use :immutable_headers - faraday.adapter Faraday.default_adapter - end - end -end diff --git a/lib/sidekiq/form526_backup_submission_process/processor.rb b/lib/sidekiq/form526_backup_submission_process/processor.rb index be58964f301..d52e1d8f531 100644 --- a/lib/sidekiq/form526_backup_submission_process/processor.rb +++ b/lib/sidekiq/form526_backup_submission_process/processor.rb @@ -6,6 +6,7 @@ require 'evss/disability_compensation_auth_headers' require 'evss/disability_compensation_form/form4142' require 'evss/disability_compensation_form/service' +require 'evss/disability_compensation_form/non_breakered_service' require 'form526_backup_submission/service' require 'form526_backup_submission/utilities/convert_to_pdf' require 'decision_review_v1/utilities/form_4142_processor'