Sha256: d87bb98e63d8b5ce7d535a7358e95c9531c3f0ae04336d74ebac553e4ef6c3e0

Contents?: true

Size: 1.16 KB

Versions: 34

Compression:

Stored size: 1.16 KB

Contents

# encoding: utf-8
require_relative "../../spec_helper"
require "sinatra"
require "logstash/api/modules/logging"
require "logstash/json"

describe LogStash::Api::Modules::Logging do
  include_context "api setup"

  describe "#logging" do

    context "when setting a logger's log level" do
      before(:all) do
        @runner = LogStashRunner.new
        @runner.start
      end

      after(:all) do
        @runner.stop
      end

      it "should return a positive acknowledgement on success" do
        put '/', '{"logger.logstash": "ERROR"}'
        payload = LogStash::Json.load(last_response.body)
        expect(payload['acknowledged']).to eq(true)
      end

      it "should throw error when level is invalid" do
        put '/', '{"logger.logstash": "invalid"}'
        payload = LogStash::Json.load(last_response.body)
        expect(payload['error']).to eq("invalid level[invalid] for logger[logstash]")
      end

      it "should throw error when key logger is invalid" do
        put '/', '{"invalid" : "ERROR"}'
        payload = LogStash::Json.load(last_response.body)
        expect(payload['error']).to eq("unrecognized option [invalid]")
      end
    end
  end
end

Version data entries

34 entries across 33 versions & 9 rubygems

Version Path
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/logstash-core-5.2.1-java/spec/api/lib/api/logging_spec.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/logstash-core-5.2.1-java/spec/api/lib/api/logging_spec.rb
mrcooper-logstash-output-azuresearch-0.2.2 vendor/jruby/2.5.0/gems/logstash-core-5.0.0-java/spec/api/lib/api/logging_spec.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/logstash-core-5.2.1-java/spec/api/lib/api/logging_spec.rb
logstash-output-icinga-1.1.0 vendor/jruby/2.3.0/gems/logstash-core-5.2.1-java/spec/api/lib/api/logging_spec.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/logstash-core-5.4.0-java/spec/api/lib/api/logging_spec.rb
logstash-core-5.4.3-java spec/api/lib/api/logging_spec.rb
logstash-core-5.4.2-java spec/api/lib/api/logging_spec.rb
logstash-filter-csharp-0.1.0 vendor/bundle/jruby/2.3.0/gems/logstash-core-5.2.1-java/spec/api/lib/api/logging_spec.rb
logstash-core-5.4.1-java spec/api/lib/api/logging_spec.rb
logstash-core-5.3.3-java spec/api/lib/api/logging_spec.rb
logstash-filter-htmlentities-0.1.0 vendor/bundle/jruby/1.9/gems/logstash-core-5.4.0-java/spec/api/lib/api/logging_spec.rb
logstash-output-icinga-1.0.0 vendor/jruby/1.9/gems/logstash-core-5.2.1-java/spec/api/lib/api/logging_spec.rb
logstash-core-6.0.0.alpha1-java spec/api/lib/api/logging_spec.rb
logstash-core-5.4.0-java spec/api/lib/api/logging_spec.rb
logstash-core-5.3.2-java spec/api/lib/api/logging_spec.rb
logstash-core-5.3.1-java spec/api/lib/api/logging_spec.rb
logstash-core-5.3.0-java spec/api/lib/api/logging_spec.rb
logstash-core-5.2.2-java spec/api/lib/api/logging_spec.rb
logstash-input-fifo-0.9.1 vendor/bundle/jruby/1.9/gems/logstash-core-5.1.1.1-java/spec/api/lib/api/logging_spec.rb