Skip to content

Commit

Permalink
Enable breakers for EVSS services (#457)
Browse files Browse the repository at this point in the history
  • Loading branch information
austin-martinez authored and jkassemi committed Nov 6, 2016
1 parent 4e9b05a commit ec23538
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 23 deletions.
9 changes: 4 additions & 5 deletions config/initializers/breakers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@

services = [
Rx::Configuration.instance.breakers_service,
SM::Configuration.instance.breakers_service
# TODO: (AJM) Disabled for testing, add these back in for launch
# EVSS::ClaimsService.breakers_service,
# EVSS::CommonService.breakers_service,
# EVSS::DocumentsService.breakers_service
SM::Configuration.instance.breakers_service,
EVSS::ClaimsService.breakers_service,
EVSS::CommonService.breakers_service,
EVSS::DocumentsService.breakers_service
]

plugin = Breakers::StatsdPlugin.new
Expand Down
2 changes: 0 additions & 2 deletions lib/evss/base_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ def initialize(headers)
@headers = headers
end

# :nocov:
def self.create_breakers_service(name:, url:)
path = URI.parse(url).path
host = URI.parse(url).host
Expand All @@ -23,7 +22,6 @@ def self.create_breakers_service(name:, url:)
request_matcher: matcher
)
end
# :nocov:

protected

Expand Down
2 changes: 0 additions & 2 deletions lib/evss/common_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ def find_rating_info(participant_id)
{ participantId: participant_id }.to_json
end

# :nocov:
# TODO: (AJM) Add spec to cover this
def create_user_account
post 'persistentPropertiesService/11.0/createUserAccount'
Expand All @@ -19,6 +18,5 @@ def create_user_account
def self.breakers_service
BaseService.create_breakers_service(name: 'EVSS/Common', url: BASE_URL)
end
# :nocov:
end
end
7 changes: 2 additions & 5 deletions spec/lib/evss/base_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
require 'rails_helper'
require 'evss/claims_service'

# :nocov:
# TODO: (AJM) Add these back when breakers is turned back on
describe EVSS::BaseService do
context 'with an outage' do
let(:service) { EVSS::ClaimsService.new({}) }
Expand All @@ -12,13 +10,12 @@
EVSS::ClaimsService.breakers_service.begin_forced_outage!
end

xit 'raises an error on get' do
it 'raises an error on get' do
expect { service.all_claims }.to raise_exception(Breakers::OutageException)
end

xit 'raises an error on post' do
it 'raises an error on post' do
expect { service.find_claim_by_id(123) }.to raise_exception(Breakers::OutageException)
end
end
end
# :nocov:
15 changes: 6 additions & 9 deletions spec/services/disability_claim_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,28 +55,25 @@
end
end

# TODO: (AJM) add these tests back when turning breakers back on (post testing)
# :nocov:
context 'when EVSS client has an outage' do
describe '#all' do
xit 'returns all claims for the user' do
it 'returns all claims for the user' do
EVSS::ClaimsService.breakers_service.begin_forced_outage!
claim = FactoryGirl.create(:disability_claim, user_uuid: user.uuid)
claims = subject.all
claims, synchronized = subject.all
expect(claims).to eq([claim])
expect(claims.first.successful_sync).to eq(false)
expect(synchronized).to eq(false)
end
end

describe '#update_from_remote' do
xit 'returns claim' do
it 'returns claim' do
EVSS::ClaimsService.breakers_service.begin_forced_outage!
claim = FactoryGirl.build(:disability_claim, user_uuid: user.uuid)
updated_claim = subject.update_from_remote(claim)
updated_claim, synchronized = subject.update_from_remote(claim)
expect(updated_claim).to eq(claim)
expect(updated_claim.successful_sync).to eq(false)
expect(synchronized).to eq(false)
end
end
# :nocov:
end
end

0 comments on commit ec23538

Please sign in to comment.