@@ -12,7 +12,7 @@ import (
1212
1313func TestNew (t * testing.T ) {
1414 apiKey := "test-api-key"
15- client := New (apiKey )
15+ client := New (apiKey , "test" )
1616
1717 assert .NotNil (t , client )
1818 assert .Equal (t , apiKey , client .apiKey )
@@ -29,7 +29,7 @@ func TestNew_WithEnvironmentVariable(t *testing.T) {
2929 os .Setenv ("CLOUDAMQP_URL" , customURL )
3030
3131 apiKey := "test-api-key"
32- client := New (apiKey )
32+ client := New (apiKey , "test" )
3333
3434 assert .NotNil (t , client )
3535 assert .Equal (t , apiKey , client .apiKey )
@@ -38,7 +38,7 @@ func TestNew_WithEnvironmentVariable(t *testing.T) {
3838
3939 // Test with empty environment variable (should use default)
4040 os .Setenv ("CLOUDAMQP_URL" , "" )
41- client = New (apiKey )
41+ client = New (apiKey , "test" )
4242
4343 assert .NotNil (t , client )
4444 assert .Equal (t , "https://customer.cloudamqp.com/api" , client .baseURL )
@@ -64,7 +64,7 @@ func TestMakeRequest_GET_Success(t *testing.T) {
6464 defer server .Close ()
6565
6666 // Create client with test server URL
67- client := NewWithBaseURL ("test-api-key" , server .URL )
67+ client := NewWithBaseURL ("test-api-key" , server .URL , "test" )
6868
6969 // Test request
7070 resp , err := client .makeRequest ("GET" , "/test" , nil )
@@ -92,7 +92,7 @@ func TestMakeRequest_POST_FormData(t *testing.T) {
9292 defer server .Close ()
9393
9494 // Create client with test server URL
95- client := NewWithBaseURL ("test-api-key" , server .URL )
95+ client := NewWithBaseURL ("test-api-key" , server .URL , "test" )
9696
9797 // Test request with form data
9898 formData := url.Values {}
@@ -123,7 +123,7 @@ func TestMakeRequest_POST_JSON(t *testing.T) {
123123 defer server .Close ()
124124
125125 // Create client with test server URL
126- client := NewWithBaseURL ("test-api-key" , server .URL )
126+ client := NewWithBaseURL ("test-api-key" , server .URL , "test" )
127127
128128 // Test request with JSON data
129129 jsonData := map [string ]string {"test" : "value" }
@@ -143,7 +143,7 @@ func TestMakeRequest_APIError_JSON(t *testing.T) {
143143 defer server .Close ()
144144
145145 // Create client with test server URL
146- client := NewWithBaseURL ("test-api-key" , server .URL )
146+ client := NewWithBaseURL ("test-api-key" , server .URL , "test" )
147147
148148 // Test request
149149 _ , err := client .makeRequest ("GET" , "/test" , nil )
@@ -161,7 +161,7 @@ func TestMakeRequest_APIError_Plain(t *testing.T) {
161161 defer server .Close ()
162162
163163 // Create client with test server URL
164- client := NewWithBaseURL ("test-api-key" , server .URL )
164+ client := NewWithBaseURL ("test-api-key" , server .URL , "test" )
165165
166166 // Test request
167167 _ , err := client .makeRequest ("GET" , "/test" , nil )
@@ -172,7 +172,7 @@ func TestMakeRequest_APIError_Plain(t *testing.T) {
172172
173173func TestMakeRequest_NetworkError (t * testing.T ) {
174174 // Create client with invalid URL
175- client := NewWithBaseURL ("test-api-key" , "http://invalid-url-that-does-not-exist" )
175+ client := NewWithBaseURL ("test-api-key" , "http://invalid-url-that-does-not-exist" , "test" )
176176
177177 // Test request
178178 _ , err := client .makeRequest ("GET" , "/test" , nil )
@@ -182,7 +182,7 @@ func TestMakeRequest_NetworkError(t *testing.T) {
182182}
183183
184184func TestMakeRequest_InvalidJSON (t * testing.T ) {
185- client := New ("test-api-key" )
185+ client := New ("test-api-key" , "test" )
186186
187187 // Test with invalid JSON data
188188 invalidData := make (chan int ) // channels can't be marshaled to JSON
0 commit comments