Sha256: b4a746df660f795f756df2108543216d443e0164721f1b9585c4978d510f008f

Contents?: true

Size: 989 Bytes

Versions: 43

Compression:

Stored size: 989 Bytes

Contents

require "logstash/outputs/elasticsearch"
require "logstash/outputs/elasticsearch/http_client"
require "logstash/outputs/elasticsearch/http_client_builder"

describe LogStash::Outputs::ElasticSearch::HttpClientBuilder do
  describe "auth setup with url encodable passwords" do
    let(:klass) { LogStash::Outputs::ElasticSearch::HttpClientBuilder }
    let(:user) { "foo@bar"}
    let(:password) {"baz@blah" }
    let(:password_secured) do
      secured = double("password")
      allow(secured).to receive(:value).and_return(password)
      secured
    end
    let(:options) { {"user" => user, "password" => password} }
    let(:logger) { mock("logger") }
    let(:auth_setup) { klass.setup_basic_auth(double("logger"), {"user" => user, "password" => password_secured}) }

    it "should return the user verbatim" do
      expect(auth_setup[:user]).to eql(user)
    end

    it "should return the password verbatim" do
      expect(auth_setup[:password]).to eql(password)
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
logstash-output-elasticsearch-6.2.1-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-6.2.0-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-6.1.0-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-6.0.0-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-5.4.1-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-5.4.0-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-5.3.5-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-5.3.4-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-5.2.1-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-5.3.3-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-5.3.2-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-5.3.1-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-5.3.0-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-5.2.0-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-5.1.2-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-5.1.1-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-5.1.0-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-4.1.3-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-4.1.2-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-2.7.1-java spec/unit/http_client_builder_spec.rb