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-4.1.1-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-4.1.0-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-3.0.2-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-3.0.1-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-3.0.0 spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-2.7.0-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-2.6.2-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-2.6.1-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-2.6.0-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-2.5.5-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-2.5.3-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-2.5.2-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-2.5.1-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-2.5.0-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-2.4.2-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-2.4.1-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-2.4.0-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-2.3.2-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-2.3.1-java spec/unit/http_client_builder_spec.rb
logstash-output-elasticsearch-2.3.0-java spec/unit/http_client_builder_spec.rb