File tree Expand file tree Collapse file tree 3 files changed +25
-9
lines changed
Expand file tree Collapse file tree 3 files changed +25
-9
lines changed Original file line number Diff line number Diff line change 66require 'faraday_middleware/aws_signers_v4'
77
88
9- module Fluent
9+ module Fluent :: Plugin
1010 class AwsElasticsearchServiceOutput < ElasticsearchOutput
1111
12- Plugin . register_output ( 'aws-elasticsearch-service' , self )
12+ Fluent :: Plugin . register_output ( 'aws-elasticsearch-service' , self )
1313
1414 config_section :endpoint do
1515 config_param :region , :string
@@ -50,6 +50,10 @@ def get_connection_options
5050 }
5151 end
5252
53+ def write ( chunk )
54+ super
55+ end
56+
5357
5458 private
5559
Original file line number Diff line number Diff line change 11# -*- encoding: utf-8 -*-
2+ require 'spec_helper'
23
3- describe Fluent ::AwsElasticsearchServiceOutput do
4- let ( :driver ) { Fluent ::Test ::OutputTestDriver . new ( Fluent ::AwsElasticsearchServiceOutput , 'test.metrics' ) . configure ( config ) }
4+ describe Fluent ::Plugin :: AwsElasticsearchServiceOutput do
5+ let ( :driver ) { Fluent ::Test ::Driver :: Output . new ( Fluent ::Plugin :: AwsElasticsearchServiceOutput ) . configure ( config ) }
56 let ( :instance ) { driver . instance }
67
78 describe "config" do
89 let ( :config ) do
910 %[
1011 <endpoint>
12+ region us-east-1
1113 url xxxxxxxxxxxxxxxxxxxx
1214 </endpoint>
1315 ]
1416 end
1517
1618 it "`endpoint` is array." do
17- expect ( instance . endpoint ) . to eq "xxxxxxxxxxxxxxxxxxxx"
19+ instance . instance_variable_get ( :@endpoint ) . map do |ep |
20+ expect ( ep [ :url ] ) . to eq "xxxxxxxxxxxxxxxxxxxx"
21+ end
1822 end
1923
20- it "should get room_id" do
21- expect ( instance . room_id ) . to eq "1234567890"
24+ it "should get region" do
25+ instance . instance_variable_get ( :@endpoint ) . map do |ep |
26+ expect ( ep [ :region ] ) . to eq "us-east-1"
27+ end
2228 end
2329
24- it "should get body" do
25- expect ( instance . body ) . to eq "some message"
30+ it "should get default values" do
31+ instance . instance_variable_get ( :@endpoint ) . map do |ep |
32+ expect ( ep [ :access_key_id ] ) . to eq ""
33+ expect ( ep [ :secret_access_key ] ) . to eq ""
34+ expect ( ep [ :assume_role_arn ] ) . to eq nil
35+ expect ( ep [ :assume_role_session_name ] ) . to eq "fluentd"
36+ end
2637 end
2738 end
2839end
Original file line number Diff line number Diff line change 11require 'fluent/load'
22require 'fluent/test'
3+ require 'fluent/test/driver/output'
34
45require 'fluent/plugin/out_aws-elasticsearch-service'
56
You can’t perform that action at this time.
0 commit comments