Skip to content

Commit 3cfcc81

Browse files
committed
Fix Faraday removed basic auth option and apply the ES client module name change.
1 parent 50a4203 commit 3cfcc81

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

logstash-core/spec/logstash/webserver_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def free_ports(servers)
191191
context "and invalid basic auth is provided" do
192192
it 'emits an HTTP 401 with WWW-Authenticate header' do
193193
response = Faraday.new("http://#{api_host}:#{webserver.port}") do |conn|
194-
conn.request :basic_auth, 'john-doe', 'open-sesame'
194+
conn.request :authorization, :basic, 'john-doe', 'open-sesame'
195195
end.get('/')
196196
aggregate_failures do
197197
expect(response.status).to eq(401)
@@ -202,7 +202,7 @@ def free_ports(servers)
202202
context "and valid auth is provided" do
203203
it "returns a relevant response" do
204204
response = Faraday.new("http://#{api_host}:#{webserver.port}") do |conn|
205-
conn.request :basic_auth, 'a-user', 's3cur3dPas!'
205+
conn.request :authorization, :basic, 'a-user', 's3cur3dPas!'
206206
end.get('/')
207207
aggregate_failures do
208208
expect(response.status).to eq(200)

qa/integration/specs/dlq_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@
8383
try(60) do
8484
begin
8585
result = es_client.search(index: 'test-index', size: 0, q: '*')
86-
rescue Elasticsearch::Transport::Transport::Errors::ServiceUnavailable => e
86+
rescue Elastic::Transport::Transport::Errors::ServiceUnavailable => e
8787
puts "Elasticsearch unavailable #{e.inspect}"
8888
hits = 0
89-
rescue Elasticsearch::Transport::Transport::Errors::NotFound => e
89+
rescue Elastic::Transport::Transport::Errors::NotFound => e
9090
puts "Index not found"
9191
hits = 0
9292
end

x-pack/qa/integration/management/multiple_pipelines_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def count_hashes(pipelines)
138138

139139
begin
140140
res = elasticsearch_client.search(index: '.monitoring-logstash-*', body: query)
141-
rescue Elasticsearch::Transport::Transport::Errors::ServiceUnavailable
141+
rescue Elastic::Transport::Transport::Errors::ServiceUnavailable
142142
return nil
143143
end
144144

x-pack/qa/integration/monitoring/es_documents_structure_validation_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
let(:retryable_errors) do
2020
[NoMethodError,
2121
RSpec::Expectations::ExpectationNotMetError,
22-
Elasticsearch::Transport::Transport::Errors::ServiceUnavailable,
23-
Elasticsearch::Transport::Transport::Errors::NotFound]
22+
Elastic::Transport::Transport::Errors::ServiceUnavailable,
23+
Elastic::Transport::Transport::Errors::NotFound]
2424
end
2525

2626
describe "metrics" do

x-pack/qa/integration/support/helpers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def cleanup_system_indices(pipeline_ids)
124124
pipeline_ids.each do |id|
125125
begin
126126
elasticsearch_client.perform_request(:delete, "_logstash/pipeline/#{id}")
127-
rescue Elasticsearch::Transport::Transport::Errors::NotFound => e
127+
rescue Elastic::Transport::Transport::Errors::NotFound => e
128128
puts ".logstash can be empty #{e.message}"
129129
end
130130
end

x-pack/qa/integration/support/shared_examples.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
let(:retryable_errors) do
1010
[NoMethodError,
1111
RSpec::Expectations::ExpectationNotMetError,
12-
Elasticsearch::Transport::Transport::Errors::ServiceUnavailable,
13-
Elasticsearch::Transport::Transport::Errors::NotFound]
12+
Elastic::Transport::Transport::Errors::ServiceUnavailable,
13+
Elastic::Transport::Transport::Errors::NotFound]
1414
end
1515

1616
describe "metrics" do

0 commit comments

Comments
 (0)