Skip to content

Commit

Permalink
add test for disabeld statsd metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
kathap committed Jan 15, 2024
1 parent 42bd7ab commit c46c880
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/unit/lib/cloud_controller/dependency_locator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,24 @@

expect(locator.statsd_client).to eq(expected_client)
end

it 'returns the null statsd client' do
host = 'test-host'
port = 1234

TestConfig.override(
statsd_host: host,
statsd_port: port,
disable_statsd_metrics: true
)

expected_client = double(CloudController::NullStatsdClient)

allow(CloudController::NullStatsdClient).to receive(:new).
and_return(expected_client)

expect(locator.statsd_client).to eq(expected_client)
end
end

describe '#bbs_stager_client' do
Expand Down

0 comments on commit c46c880

Please sign in to comment.