1111 let ( :cloud_config ) do
1212 %{
1313 source_token abcd1234
14- ingesting_host s1234.g1 .betterstackdata.com
14+ ingesting_host s1234.eu-nbg-2 .betterstackdata.com
1515 }
1616 end
1717
@@ -48,16 +48,16 @@ def format(tag, time, record)
4848 end
4949
5050 describe "#write" do
51- it "should send a chunked request to the Logtail API" do
52- stub = stub_request ( :post , "https://s1234.g1.betterstackdata .com/" ) .
51+ it "should send a chunked request to the Logtail API using default host " do
52+ stub = stub_request ( :post , "https://in.logs.betterstack .com/" ) .
5353 with (
5454 :body => start_with ( "\xDD \x00 \x00 \x00 \x01 \x85 \xA3 age\x1A \xAA request_id\xA2 42\xA9 parent_id\xA6 parent\xAA routing_id\xA7 routing\xA2 dt\xB4 " . force_encoding ( "ASCII-8BIT" ) ) ,
5555 :headers => { 'Accept' => '*/*' , 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3' , 'Authorization' => 'Bearer abcd1234' , 'Content-Type' => 'application/msgpack' , 'User-Agent' => 'Logtail Fluentd/0.1.1' }
5656 ) .
5757 to_return ( :status => 202 , :body => "" , :headers => { } )
5858
59- cloud_driver . emit ( record )
60- cloud_driver . run
59+ driver . emit ( record )
60+ driver . run
6161
6262 expect ( stub ) . to have_been_requested . times ( 1 )
6363 end
@@ -83,15 +83,15 @@ def format(tag, time, record)
8383
8484 describe "#write to cloud" do
8585 it "should send a chunked request to the Logtail API" do
86- stub = stub_request ( :post , "https://in.logs.betterstack .com/" ) .
86+ stub = stub_request ( :post , "https://s1234.eu-nbg-2.betterstackdata .com/" ) .
8787 with (
8888 :body => start_with ( "\xDD \x00 \x00 \x00 \x01 \x85 \xA3 age\x1A \xAA request_id\xA2 42\xA9 parent_id\xA6 parent\xAA routing_id\xA7 routing\xA2 dt\xB4 " . force_encoding ( "ASCII-8BIT" ) ) ,
8989 :headers => { 'Accept' => '*/*' , 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3' , 'Authorization' => 'Bearer abcd1234' , 'Content-Type' => 'application/msgpack' , 'User-Agent' => 'Logtail Fluentd/0.1.1' }
9090 ) .
9191 to_return ( :status => 202 , :body => "" , :headers => { } )
9292
93- driver . emit ( record )
94- driver . run
93+ cloud_driver . emit ( record )
94+ cloud_driver . run
9595
9696 expect ( stub ) . to have_been_requested . times ( 1 )
9797 end
0 commit comments