File tree Expand file tree Collapse file tree 3 files changed +3
-27
lines changed
Expand file tree Collapse file tree 3 files changed +3
-27
lines changed Original file line number Diff line number Diff line change 1212 }
1313 }
1414 let ( :index ) { 10 . times . collect { rand ( 10 ) . to_s } . join ( "" ) }
15- let ( :type ) { 10 . times . collect { rand ( 10 ) . to_s } . join ( "" ) }
15+ let ( :type ) { ESHelper . es_version_satisfies? ( "<= 6.3" ) ? "doc" : "_doc" }
16+
1617 subject { LogStash ::Outputs ::ElasticSearch . new ( config ) }
1718
1819 before do
Original file line number Diff line number Diff line change 77 shared_examples "a join field based parent indexer" do
88 let ( :index ) { 10 . times . collect { rand ( 10 ) . to_s } . join ( "" ) }
99
10- let ( :type ) do
11- if ESHelper . es_version_satisfies? ( '<7' )
12- 10 . times . collect { rand ( 10 ) . to_s } . join ( "" )
13- else
14- "_doc"
15- end
16- end
10+ let ( :type ) { ESHelper . es_version_satisfies? ( "<= 6.3" ) ? "doc" : "_doc" }
1711
1812 let ( :event_count ) { 10000 + rand ( 500 ) }
1913 let ( :parent ) { "not_implemented" }
Original file line number Diff line number Diff line change 6363 expect ( subject . send ( :get_event_type , LogStash ::Event . new ( "type" => "foo" ) ) ) . to eql ( "doc" )
6464 end
6565 end
66-
67- context "with a bad type event field in a < 6.0 es cluster" do
68- let ( :maximum_seen_major_version ) { 5 }
69- let ( :type_arg ) { [ "foo" ] }
70- let ( :result ) { subject . send ( :get_event_type , LogStash ::Event . new ( "type" => type_arg ) ) }
71-
72- before do
73- allow ( subject . instance_variable_get ( :@logger ) ) . to receive ( :warn )
74- result
75- end
76-
77- it "should call @logger.warn and return nil" do
78- expect ( subject . instance_variable_get ( :@logger ) ) . to have_received ( :warn ) . with ( /Bad event type!/ , anything ) . once
79- end
80-
81- it "should set the type to the stringified value" do
82- expect ( result ) . to eql ( type_arg . to_s )
83- end
84- end
8566 end
8667
8768 describe "with auth" do
You can’t perform that action at this time.
0 commit comments