diff --git a/elasticsearch-transport/spec/elasticsearch/transport/client_spec.rb b/elasticsearch-transport/spec/elasticsearch/transport/client_spec.rb index 57aa45eea1..fb929375f2 100644 --- a/elasticsearch-transport/spec/elasticsearch/transport/client_spec.rb +++ b/elasticsearch-transport/spec/elasticsearch/transport/client_spec.rb @@ -266,7 +266,7 @@ it 'uses Faraday with the adapter' do expect(adapter).to eq Faraday::Adapter::Typhoeus end - end + end unless jruby? context 'when the adapter is specified as a string key' do let(:adapter) do @@ -1758,7 +1758,7 @@ it 'preserves the other headers' do expect(client.transport.connections[0].connection.headers['User-Agent']) end - end + end unless jruby? end end diff --git a/elasticsearch-transport/test/integration/transport_test.rb b/elasticsearch-transport/test/integration/transport_test.rb index 845b7d10f8..15babf4f41 100644 --- a/elasticsearch-transport/test/integration/transport_test.rb +++ b/elasticsearch-transport/test/integration/transport_test.rb @@ -24,7 +24,7 @@ class Elasticsearch::Transport::ClientIntegrationTest < Minitest::Test begin; Object.send(:remove_const, :Patron); rescue NameError; end end - should "allow to customize the Faraday adapter" do + should "allow to customize the Faraday adapter to Typhoeus" do require 'typhoeus' require 'typhoeus/adapters/faraday' @@ -34,6 +34,19 @@ class Elasticsearch::Transport::ClientIntegrationTest < Minitest::Test f.adapter :typhoeus end + client = Elasticsearch::Transport::Client.new transport: transport + client.perform_request 'GET', '' + end unless jruby? + + should "allow to customize the Faraday adapter to NetHttpPersistent" do + require 'net/http/persistent' + + transport = Elasticsearch::Transport::Transport::HTTP::Faraday.new \ + :hosts => [ { host: @host, port: @port } ] do |f| + f.response :logger + f.adapter :net_http_persistent + end + client = Elasticsearch::Transport::Client.new transport: transport client.perform_request 'GET', '' end