88 Java ::OrgLogstashConfigIr ::DSL
99 end
1010
11+ def rand_meta
12+ org . logstash . common . SourceWithMetadata . new ( "test" , SecureRandom . uuid , 1 , 1 , SecureRandom . uuid )
13+ end
14+
1115 let ( :source_protocol ) { "test_proto" }
1216
1317 let ( :settings ) { mock_settings ( { } ) }
@@ -173,7 +177,7 @@ def j
173177 let ( :plugin_source ) { "generator {}" }
174178
175179 it "should contain the plugin" do
176- expect ( c_plugin ) . to ir_eql ( j . iPlugin ( INPUT , "generator" ) )
180+ expect ( c_plugin ) . to ir_eql ( j . iPlugin ( rand_meta , INPUT , "generator" ) )
177181 end
178182 end
179183
@@ -190,7 +194,7 @@ def j
190194 end
191195
192196 it "should contain the plugin" do
193- expect ( c_plugin ) . to ir_eql ( j . iPlugin ( INPUT , "generator" , expected_plugin_args ) )
197+ expect ( c_plugin ) . to ir_eql ( j . iPlugin ( rand_meta , INPUT , "generator" , expected_plugin_args ) )
194198 end
195199 end
196200
@@ -203,7 +207,7 @@ def j
203207 end
204208
205209 it "should contain the plugin" do
206- expect ( c_plugin ) . to ir_eql ( j . iPlugin ( INPUT , "generator" , expected_plugin_args ) )
210+ expect ( c_plugin ) . to ir_eql ( j . iPlugin ( rand_meta , INPUT , "generator" , expected_plugin_args ) )
207211 end
208212 end
209213
@@ -216,7 +220,7 @@ def j
216220 end
217221
218222 it "should contain the plugin" do
219- expect ( c_plugin ) . to ir_eql ( j . iPlugin ( INPUT , "generator" , expected_plugin_args ) )
223+ expect ( c_plugin ) . to ir_eql ( j . iPlugin ( rand_meta , INPUT , "generator" , expected_plugin_args ) )
220224 end
221225 end
222226
@@ -245,7 +249,7 @@ def j
245249 end
246250
247251 it "should merge the contents of the individual directives" do
248- expect ( c_plugin ) . to ir_eql ( j . iPlugin ( FILTER , "grok" , expected_plugin_args ) )
252+ expect ( c_plugin ) . to ir_eql ( j . iPlugin ( rand_meta , FILTER , "grok" , expected_plugin_args ) )
249253 end
250254
251255 describe "a filter plugin that has nested Hash directives" do
@@ -300,7 +304,7 @@ def j
300304 end
301305
302306 it "should produce a nested ::Hash object" do
303- expect ( c_plugin ) . to ir_eql ( j . iPlugin ( FILTER , "matryoshka" , expected_plugin_args ) )
307+ expect ( c_plugin ) . to ir_eql ( j . iPlugin ( rand_meta , FILTER , "matryoshka" , expected_plugin_args ) )
304308 end
305309 end
306310 end
@@ -313,7 +317,7 @@ def j
313317 let ( :source ) { "input { generator {} }" }
314318
315319 it "should contain the single input" do
316- expect ( input ) . to ir_eql ( j . iPlugin ( INPUT , "generator" ) )
320+ expect ( input ) . to ir_eql ( j . iPlugin ( rand_meta , INPUT , "generator" ) )
317321 end
318322
319323 it_should_behave_like ( "component source_with_metadata" ) do
@@ -326,8 +330,8 @@ def j
326330
327331 it "should contain both inputs" do
328332 expect ( input ) . to ir_eql ( j . iComposeParallel (
329- j . iPlugin ( INPUT , "generator" , { "count" => 1 } ) ,
330- j . iPlugin ( INPUT , "generator" , { "count" => 2 } )
333+ j . iPlugin ( rand_meta , INPUT , "generator" , { "count" => 1 } ) ,
334+ j . iPlugin ( rand_meta , INPUT , "generator" , { "count" => 2 } )
331335 ) )
332336 end
333337 end
@@ -351,7 +355,7 @@ def j
351355 let ( :compiled_section ) { compiled [ section ] }
352356
353357 def splugin ( *args )
354- j . iPlugin ( section_name_enum , *args )
358+ j . iPlugin ( rand_meta , section_name_enum , *args )
355359 end
356360
357361 def compose ( *statements )
@@ -635,6 +639,7 @@ def compose(*statements)
635639
636640 it "should compile correctly" do
637641 expect ( compiled_section ) . to ir_eql ( j . iIf (
642+ rand_meta ,
638643 j . eEq ( j . eEventValue ( "[foo]" ) , j . eEventValue ( "[bar]" ) ) ,
639644 splugin ( "grok" )
640645 )
@@ -647,6 +652,7 @@ def compose(*statements)
647652
648653 it "should compile correctly" do
649654 expect ( compiled_section ) . to ir_eql ( j . iIf (
655+ rand_meta ,
650656 j . eEq ( j . eEventValue ( "[foo]" ) , j . eEventValue ( "[bar]" ) ) ,
651657 j . noop ,
652658 splugin ( "fplugin" ) ,
@@ -660,6 +666,7 @@ def compose(*statements)
660666
661667 it "should compile correctly" do
662668 expect ( compiled_section ) . to ir_eql ( j . iIf (
669+ rand_meta ,
663670 j . eEq ( j . eEventValue ( "[foo]" ) , j . eEventValue ( "[bar]" ) ) ,
664671 j . noop ,
665672 j . noop
@@ -673,6 +680,7 @@ def compose(*statements)
673680
674681 it "should compile correctly" do
675682 expect ( compiled_section ) . to ir_eql ( j . iIf (
683+ rand_meta ,
676684 j . eEq ( j . eEventValue ( "[foo]" ) , j . eEventValue ( "[bar]" ) ) ,
677685 splugin ( "tplugin" ) ,
678686 splugin ( "fplugin" )
@@ -686,9 +694,11 @@ def compose(*statements)
686694
687695 it "should compile correctly" do
688696 expect ( compiled_section ) . to ir_eql ( j . iIf (
697+ rand_meta ,
689698 j . eEq ( j . eEventValue ( "[foo]" ) , j . eEventValue ( "[bar]" ) ) ,
690699 splugin ( "tplugin" ) ,
691700 j . iIf (
701+ rand_meta ,
692702 j . eEq ( j . eEventValue ( "[bar]" ) , j . eEventValue ( "[baz]" ) ) ,
693703 splugin ( "eifplugin" ) ,
694704 splugin ( "fplugin" )
@@ -712,12 +722,15 @@ def compose(*statements)
712722
713723 it "should compile correctly" do
714724 expect ( compiled_section ) . to ir_eql ( j . iIf (
725+ rand_meta ,
715726 j . eEq ( j . eEventValue ( "[foo]" ) , j . eEventValue ( "[bar]" ) ) ,
716727 splugin ( "tplugin" ) ,
717728 j . iIf (
729+ rand_meta ,
718730 j . eEq ( j . eEventValue ( "[bar]" ) , j . eEventValue ( "[baz]" ) ) ,
719731 splugin ( "eifplugin" ) ,
720732 j . iIf (
733+ rand_meta ,
721734 j . eEq ( j . eEventValue ( "[baz]" ) , j . eEventValue ( "[bot]" ) ) ,
722735 splugin ( "eeifplugin" ) ,
723736 splugin ( "fplugin" )
@@ -744,15 +757,18 @@ def compose(*statements)
744757
745758 it "should compile correctly" do
746759 expect ( compiled_section ) . to ir_eql ( j . iIf (
760+ rand_meta ,
747761 j . eEq ( j . eEventValue ( "[foo]" ) , j . eEventValue ( "[bar]" ) ) ,
748- j . iIf ( j . eEq ( j . eEventValue ( "[bar]" ) , j . eEventValue ( "[baz]" ) ) ,
762+ j . iIf ( rand_meta , j . eEq ( j . eEventValue ( "[bar]" ) , j . eEventValue ( "[baz]" ) ) ,
749763 splugin ( "aplugin" ) ,
750764 j . noop
751765 ) ,
752766 j . iIf (
767+ rand_meta ,
753768 j . eEq ( j . eEventValue ( "[bar]" ) , j . eEventValue ( "[baz]" ) ) ,
754769 splugin ( "bplugin" ) ,
755770 j . iIf (
771+ rand_meta ,
756772 j . eEq ( j . eEventValue ( "[baz]" ) , j . eEventValue ( "[bot]" ) ) ,
757773 splugin ( "cplugin" ) ,
758774 splugin ( "dplugin" )
@@ -773,7 +789,7 @@ def compose(*statements)
773789 let ( :source ) { "input { } filter { grok {} } output { }" }
774790
775791 it "should contain the single filter" do
776- expect ( filter ) . to ir_eql ( j . iPlugin ( FILTER , "grok" ) )
792+ expect ( filter ) . to ir_eql ( j . iPlugin ( rand_meta , FILTER , "grok" ) )
777793 end
778794
779795 it_should_behave_like ( "component source_with_metadata" ) do
@@ -791,7 +807,7 @@ def compose(*statements)
791807 let ( :source ) { "input { } output { stdout {} }" }
792808
793809 it "should contain the single input" do
794- expect ( output ) . to ir_eql ( j . iPlugin ( OUTPUT , "stdout" ) )
810+ expect ( output ) . to ir_eql ( j . iPlugin ( rand_meta , OUTPUT , "stdout" ) )
795811 end
796812
797813 it_should_behave_like ( "component source_with_metadata" ) do
0 commit comments