diff --git a/modules/claims_api/config/initializers/okcomputer.rb b/modules/claims_api/config/initializers/okcomputer.rb index 5b735d00f98..5a5c8ff7d3e 100644 --- a/modules/claims_api/config/initializers/okcomputer.rb +++ b/modules/claims_api/config/initializers/okcomputer.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require 'bgs/services' require 'mpi/service' require 'bgs_service/local_bgs' @@ -38,28 +37,6 @@ def name end end -class BgsCheck < BaseCheck - def initialize(service) - @service = service - end - - def check - service = BGS::Services.new( - external_uid: 'healthcheck_uid', - external_key: 'healthcheck_key' - ) - service.send(@service).healthy? ? process_success : process_failure - rescue - process_failure - end - - protected - - def name - "BGS #{@service}" - end -end - class FaradayBGSCheck < BaseCheck def initialize(endpoint) @endpoint = endpoint @@ -159,11 +136,10 @@ def faraday_client end OkComputer::Registry.register 'mpi', MpiCheck.new -OkComputer::Registry.register 'bgs-vet_record', BgsCheck.new('vet_record') -OkComputer::Registry.register 'bgs-corporate_update', BgsCheck.new('corporate_update') -OkComputer::Registry.register 'bgs-contention', BgsCheck.new('contention') OkComputer::Registry.register 'localbgs-claimant', FaradayBGSCheck.new('ClaimantServiceBean/ClaimantWebService') +OkComputer::Registry.register 'localbgs-corporate_update', + FaradayBGSCheck.new('CorporateUpdateServiceBean/CorporateUpdateWebService') OkComputer::Registry.register 'localbgs-person', FaradayBGSCheck.new('PersonWebServiceBean/PersonWebService') OkComputer::Registry.register 'localbgs-org', diff --git a/modules/claims_api/spec/requests/metadata_spec.rb b/modules/claims_api/spec/requests/metadata_spec.rb index b0f643d1ee6..ed5ad921e64 100644 --- a/modules/claims_api/spec/requests/metadata_spec.rb +++ b/modules/claims_api/spec/requests/metadata_spec.rb @@ -41,9 +41,6 @@ context version do it 'returns correct response and status when healthy' do allow(MPI::Service).to receive(:service_is_up?).and_return(true) - allow_any_instance_of(BGS::Services).to receive(:vet_record).and_return(Struct.new(:healthy?).new(true)) - allow_any_instance_of(BGS::Services).to receive(:contention).and_return(Struct.new(:healthy?).new(true)) - allow_any_instance_of(BGS::Services).to receive(:corporate_update).and_return(Struct.new(:healthy?).new(true)) allow_any_instance_of(ClaimsApi::LocalBGS).to receive(:healthcheck).and_return(200) allow_any_instance_of(Faraday::Connection).to receive(:get).and_return(Struct.new(:status).new(200)) get "/services/claims/#{version}/upstream_healthcheck" @@ -71,17 +68,6 @@ end end end - - bgs_services = %i[vet_record corporate_update contention].freeze - bgs_services.each do |service| - it "returns the correct status when the BGS #{service} is not healthy" do - allow_any_instance_of(BGS::Services).to receive(service.to_sym) - .and_return(Struct.new(:healthy?).new(false)) - get "/services/claims/#{version}/upstream_healthcheck" - result = JSON.parse(response.body) - expect(result["bgs-#{service}"]['success']).to eq(false) - end - end end end end