fluent-plugin-elasticsearch 1.18.2 → 2.0.0.rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,40 +0,0 @@
1
- require 'helper'
2
- require 'date'
3
- require 'json'
4
- require 'flexmock/test_unit'
5
- require 'fluent/plugin/filter_elasticsearch_genid'
6
-
7
- class ElasticsearchGenidFilterTest < Test::Unit::TestCase
8
- include FlexMock::TestCase
9
-
10
- def setup
11
- Fluent::Test.setup
12
- end
13
-
14
- def create_driver(conf='')
15
- Fluent::Test::FilterTestDriver.new(Fluent::ElasticsearchGenidFilter).configure(conf)
16
- end
17
-
18
- def sample_record
19
- {'age' => 26, 'request_id' => '42', 'parent_id' => 'parent', 'routing_id' => 'routing'}
20
- end
21
-
22
- def test_configure
23
- d = create_driver
24
- assert_equal '_hash', d.instance.hash_id_key
25
- end
26
-
27
- data("default" => {"hash_id_key" => "_hash"},
28
- "custom_key" => {"hash_id_key" => "_edited"},
29
- )
30
- def test_filter(data)
31
- d = create_driver("hash_id_key #{data["hash_id_key"]}")
32
- flexmock(SecureRandom).should_receive(:uuid)
33
- .and_return("13a0c028-bf7c-4ae2-ad03-ec09a40006df")
34
- d.run do
35
- d.filter(sample_record)
36
- end
37
- assert_equal(Base64.strict_encode64(SecureRandom.uuid),
38
- d.filtered_as_array.map {|e| e.last}.first[d.instance.hash_id_key])
39
- end
40
- end
data/test/test_log-ext.rb DELETED
@@ -1,33 +0,0 @@
1
- require 'helper'
2
- require 'fluent/log-ext'
3
-
4
- class TestFluentLogExtHandler < Test::Unit::TestCase
5
- def setup
6
- @log = Fluent::Test::TestLogger.new
7
- @log.level = "info"
8
- end
9
-
10
- def test_trace?
11
- assert_false @log.respond_to?(:trace?)
12
- end
13
-
14
- def test_debug?
15
- assert_true @log.respond_to?(:debug?)
16
- end
17
-
18
- def test_info?
19
- assert_true @log.respond_to?(:info?)
20
- end
21
-
22
- def test_warn?
23
- assert_true @log.respond_to?(:warn?)
24
- end
25
-
26
- def test_error?
27
- assert_true @log.respond_to?(:error?)
28
- end
29
-
30
- def test_fatal?
31
- assert_true @log.respond_to?(:fatal?)
32
- end
33
- end