Skip to content

Commit

Permalink
Test: adjust (random) plugin.id expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
kares committed Jul 8, 2021
1 parent 2a51189 commit 5ed09ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions logstash-core/spec/logstash/java_pipeline_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,16 @@ def flush(options)
pipeline.close
end

it "should use LIR provided IDs" do
expect(pipeline.inputs.first.id).to eq(pipeline.lir.input_plugin_vertices.first.id)
expect(pipeline.filters.first.id).to eq(pipeline.lir.filter_plugin_vertices.first.id)
expect(pipeline.outputs.first.id).to eq(pipeline.lir.output_plugin_vertices.first.id)
it "should generate plugin ids" do
input_id = pipeline.inputs.first.id
filter_id = pipeline.filters.first.id
output_id = pipeline.outputs.first.id
[ input_id, filter_id, output_id ].each do |plugin_id|
expect(plugin_id).to match /([0-9]|[a-f])+/
end
expect( input_id ).to_not eq filter_id
expect( input_id ).to_not eq output_id
expect( output_id ).to_not eq filter_id
end
end

Expand Down
4 changes: 2 additions & 2 deletions logstash-core/spec/logstash/plugin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ def register; end
context "when the id is not provided provided" do
subject { plugin.new(config) }

it "return a human readable ID" do
expect(subject.id).to match(/^simple_plugin_/)
it "generates an id" do
expect(subject.id).to match /([0-9]|[a-f])+/
end
end
end
Expand Down

0 comments on commit 5ed09ac

Please sign in to comment.