|
313 | 313 | 'sample:dXMtY2VudHJhbDEuZ2NwLmNsb3VkLmVzLmlvJGFjMzFlYmI5MDI0MTc3MzE1NzA0M2MzNGZkMjZmZDQ2OjkyNDMkYTRjMDYyMzBlNDhjOGZjZTdiZTg4YTA3NGEzYmIzZTA6OTI0NA==' |
314 | 314 | end |
315 | 315 |
|
316 | | - let(:config) { super.merge({ 'cloud_id' => valid_cloud_id }) } |
| 316 | + let(:config) { super().merge({ 'cloud_id' => valid_cloud_id }) } |
317 | 317 |
|
318 | 318 | it "should set host(s)" do |
319 | 319 | plugin.register |
|
328 | 328 | end |
329 | 329 |
|
330 | 330 | context 'invalid' do |
331 | | - let(:config) { super.merge({ 'cloud_id' => 'invalid:dXMtY2VudHJhbDEuZ2NwLmNsb3VkLmVzLmlv' }) } |
| 331 | + let(:config) { super().merge({ 'cloud_id' => 'invalid:dXMtY2VudHJhbDEuZ2NwLmNsb3VkLmVzLmlv' }) } |
332 | 332 |
|
333 | 333 | it "should fail" do |
334 | 334 | expect { plugin.register }.to raise_error LogStash::ConfigurationError, /cloud_id.*? is invalid/ |
335 | 335 | end |
336 | 336 | end |
337 | 337 |
|
338 | 338 | context 'hosts also set' do |
339 | | - let(:config) { super.merge({ 'cloud_id' => valid_cloud_id, 'hosts' => [ 'localhost:9200' ] }) } |
| 339 | + let(:config) { super().merge({ 'cloud_id' => valid_cloud_id, 'hosts' => [ 'localhost:9200' ] }) } |
340 | 340 |
|
341 | 341 | it "should fail" do |
342 | 342 | expect { plugin.register }.to raise_error LogStash::ConfigurationError, /cloud_id and hosts/ |
|
345 | 345 | end if LOGSTASH_VERSION > '6.0' |
346 | 346 |
|
347 | 347 | describe "cloud.auth" do |
348 | | - let(:config) { super.merge({ 'cloud_auth' => LogStash::Util::Password.new('elastic:my-passwd-00') }) } |
| 348 | + let(:config) { super().merge({ 'cloud_auth' => LogStash::Util::Password.new('elastic:my-passwd-00') }) } |
349 | 349 |
|
350 | 350 | it "should set authorization" do |
351 | 351 | plugin.register |
|
356 | 356 | end |
357 | 357 |
|
358 | 358 | context 'invalid' do |
359 | | - let(:config) { super.merge({ 'cloud_auth' => 'invalid-format' }) } |
| 359 | + let(:config) { super().merge({ 'cloud_auth' => 'invalid-format' }) } |
360 | 360 |
|
361 | 361 | it "should fail" do |
362 | 362 | expect { plugin.register }.to raise_error LogStash::ConfigurationError, /cloud_auth.*? format/ |
363 | 363 | end |
364 | 364 | end |
365 | 365 |
|
366 | 366 | context 'user also set' do |
367 | | - let(:config) { super.merge({ 'cloud_auth' => 'elastic:my-passwd-00', 'user' => 'another' }) } |
| 367 | + let(:config) { super().merge({ 'cloud_auth' => 'elastic:my-passwd-00', 'user' => 'another' }) } |
368 | 368 |
|
369 | 369 | it "should fail" do |
370 | 370 | expect { plugin.register }.to raise_error LogStash::ConfigurationError, /Multiple authentication options are specified/ |
|
374 | 374 |
|
375 | 375 | describe "api_key" do |
376 | 376 | context "without ssl" do |
377 | | - let(:config) { super.merge({ 'api_key' => LogStash::Util::Password.new('foo:bar') }) } |
| 377 | + let(:config) { super().merge({ 'api_key' => LogStash::Util::Password.new('foo:bar') }) } |
378 | 378 |
|
379 | 379 | it "should fail" do |
380 | 380 | expect { plugin.register }.to raise_error LogStash::ConfigurationError, /api_key authentication requires SSL\/TLS/ |
381 | 381 | end |
382 | 382 | end |
383 | 383 |
|
384 | 384 | context "with ssl" do |
385 | | - let(:config) { super.merge({ 'api_key' => LogStash::Util::Password.new('foo:bar'), "ssl" => true }) } |
| 385 | + let(:config) { super().merge({ 'api_key' => LogStash::Util::Password.new('foo:bar'), "ssl" => true }) } |
386 | 386 |
|
387 | 387 | it "should set authorization" do |
388 | 388 | plugin.register |
|
393 | 393 | end |
394 | 394 |
|
395 | 395 | context 'user also set' do |
396 | | - let(:config) { super.merge({ 'api_key' => 'foo:bar', 'user' => 'another' }) } |
| 396 | + let(:config) { super().merge({ 'api_key' => 'foo:bar', 'user' => 'another' }) } |
397 | 397 |
|
398 | 398 | it "should fail" do |
399 | 399 | expect { plugin.register }.to raise_error LogStash::ConfigurationError, /Multiple authentication options are specified/ |
|
404 | 404 |
|
405 | 405 | describe "proxy" do |
406 | 406 | context 'valid' do |
407 | | - let(:config) { super.merge({ 'proxy' => 'http://localhost:1234' }) } |
| 407 | + let(:config) { super().merge({ 'proxy' => 'http://localhost:1234' }) } |
408 | 408 |
|
409 | 409 | it "should set proxy" do |
410 | 410 | plugin.register |
|
416 | 416 | end |
417 | 417 |
|
418 | 418 | context 'invalid' do |
419 | | - let(:config) { super.merge({ 'proxy' => '${A_MISSING_ENV_VAR:}' }) } |
| 419 | + let(:config) { super().merge({ 'proxy' => '${A_MISSING_ENV_VAR:}' }) } |
420 | 420 |
|
421 | 421 | it "should not set proxy" do |
422 | 422 | plugin.register |
|
0 commit comments