@@ -26,15 +26,18 @@ def initialize
2626 options = ConfigurationBuilder . new ( api_key : 'YOUR_API_KEY' , api_url : 'https://api.securenative-stg.com/collector/api/v1' )
2727 event = SampleEvent . new
2828
29- stub_request ( :post , 'https://api.securenative-stg.com/collector/api/v1/some-path/to-api' )
30- . with ( headers : {
31- 'Accept' => '*/*' ,
32- 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3' ,
33- 'Authorization' => 'YOUR_API_KEY' ,
34- 'Content-Type' => 'application/json' ,
35- 'Sn-Version' => '0.1.21' ,
36- 'User-Agent' => 'SecureNative-ruby'
37- } ) . to_return ( status : 200 , body : '' , headers : { } )
29+ stub_request ( :post , "https://api.securenative-stg.com/collector/api/v1/some-path/to-api" ) .
30+ with (
31+ headers : {
32+ 'Accept' => '*/*' ,
33+ 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3' ,
34+ 'Authorization' => 'YOUR_API_KEY' ,
35+ 'Content-Type' => 'application/json' ,
36+ 'Sn-Version' => '0.1.22' ,
37+ 'User-Agent' => 'SecureNative-ruby'
38+ } ) .
39+ to_return ( status : 200 , body : "" , headers : { } )
40+
3841 event_manager = EventManager . new ( options )
3942
4043 event_manager . start_event_persist
@@ -48,15 +51,17 @@ def initialize
4851 options = ConfigurationBuilder . new ( api_key : 'YOUR_API_KEY' , api_url : 'https://api.securenative-stg.com/collector/api/v1' )
4952 event = SampleEvent . new
5053
51- stub_request ( :post , 'https://api.securenative-stg.com/collector/api/v1/some-path/to-api' )
52- . with ( headers : {
53- 'Accept' => '*/*' ,
54- 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3' ,
55- 'Authorization' => 'YOUR_API_KEY' ,
56- 'Content-Type' => 'application/json' ,
57- 'Sn-Version' => '0.1.21' ,
58- 'User-Agent' => 'SecureNative-ruby'
59- } ) . to_return ( status : 401 , body : '' , headers : { } )
54+ stub_request ( :post , "https://api.securenative-stg.com/collector/api/v1/some-path/to-api" ) .
55+ with (
56+ headers : {
57+ 'Accept' => '*/*' ,
58+ 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3' ,
59+ 'Authorization' => 'YOUR_API_KEY' ,
60+ 'Content-Type' => 'application/json' ,
61+ 'Sn-Version' => '0.1.22' ,
62+ 'User-Agent' => 'SecureNative-ruby'
63+ } ) .
64+ to_return ( status : 401 , body : "" , headers : { } )
6065
6166 event_manager = EventManager . new ( options )
6267 res = event_manager . send_sync ( event , 'some-path/to-api' , false )
@@ -68,15 +73,18 @@ def initialize
6873 options = ConfigurationBuilder . new ( api_key : 'YOUR_API_KEY' , api_url : 'https://api.securenative-stg.com/collector/api/v1' )
6974 event = SampleEvent . new
7075
71- stub_request ( :post , 'https://api.securenative-stg.com/collector/api/v1/some-path/to-api' )
72- . with ( headers : {
73- 'Accept' => '*/*' ,
74- 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3' ,
75- 'Authorization' => 'YOUR_API_KEY' ,
76- 'Content-Type' => 'application/json' ,
77- 'Sn-Version' => '0.1.21' ,
78- 'User-Agent' => 'SecureNative-ruby'
79- } ) . to_return ( status : 500 , body : '' , headers : { } )
76+ stub_request ( :post , "https://api.securenative-stg.com/collector/api/v1/some-path/to-api" ) .
77+ with (
78+ headers : {
79+ 'Accept' => '*/*' ,
80+ 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3' ,
81+ 'Authorization' => 'YOUR_API_KEY' ,
82+ 'Content-Type' => 'application/json' ,
83+ 'Sn-Version' => '0.1.22' ,
84+ 'User-Agent' => 'SecureNative-ruby'
85+ } ) .
86+ to_return ( status : 500 , body : "" , headers : { } )
87+
8088 event_manager = EventManager . new ( options )
8189 res = event_manager . send_sync ( event , 'some-path/to-api' , false )
8290
0 commit comments