@@ -1317,8 +1317,7 @@ func TestErrorReceived(t *testing.T) {
1317
1317
case <- time .After (5 * time .Second ):
1318
1318
t .Fatal ("Should have received request" )
1319
1319
}
1320
- errMsg := fmt .Sprintf ("HTTP %q %d %q" ,
1321
- cfg .ClientConfig .Endpoint ,
1320
+ errMsg := fmt .Sprintf ("HTTP \" /services/collector\" %d %q" ,
1322
1321
http .StatusInternalServerError ,
1323
1322
http .StatusText (http .StatusInternalServerError ),
1324
1323
)
@@ -1400,9 +1399,8 @@ func TestHeartbeatStartupFailed(t *testing.T) {
1400
1399
assert .NoError (t , err )
1401
1400
assert .EqualError (t ,
1402
1401
exporter .Start (context .Background (), componenttest .NewNopHost ()),
1403
- fmt .Sprintf ("%s: heartbeat on startup failed: HTTP %q 403 \" Forbidden\" " ,
1402
+ fmt .Sprintf ("%s: heartbeat on startup failed: HTTP \" /services/collector \" 403 \" Forbidden\" " ,
1404
1403
params .ID .String (),
1405
- cfg .ClientConfig .Endpoint ,
1406
1404
),
1407
1405
)
1408
1406
assert .NoError (t , exporter .Shutdown (context .Background ()))
@@ -1602,7 +1600,7 @@ func Test_pushLogData_PostError(t *testing.T) {
1602
1600
1603
1601
func Test_pushLogData_ShouldAddResponseTo400Error (t * testing.T ) {
1604
1602
config := NewFactory ().CreateDefaultConfig ().(* Config )
1605
- url := & url.URL {Scheme : "http" , Host : "splunk" }
1603
+ url := & url.URL {Scheme : "http" , Host : "splunk" , Path : "/v1/endpoint" }
1606
1604
splunkClient := newLogsClient (exportertest .NewNopSettings (metadata .Type ), NewFactory ().CreateDefaultConfig ().(* Config ))
1607
1605
logs := createLogData (1 , 1 , 1 )
1608
1606
@@ -1614,7 +1612,7 @@ func Test_pushLogData_ShouldAddResponseTo400Error(t *testing.T) {
1614
1612
// Sending logs using the client.
1615
1613
err := splunkClient .pushLogData (context .Background (), logs )
1616
1614
require .True (t , consumererror .IsPermanent (err ), "Expecting permanent error" )
1617
- require .EqualError (t , err , "Permanent error: HTTP \" http://splunk \" 400 \" Bad Request\" " )
1615
+ require .EqualError (t , err , "Permanent error: HTTP \" /v1/endpoint \" 400 \" Bad Request\" " )
1618
1616
// The returned error should contain the response body responseBody.
1619
1617
1620
1618
// An HTTP client that returns some other status code other than 400 and response body responseBody.
@@ -1623,7 +1621,7 @@ func Test_pushLogData_ShouldAddResponseTo400Error(t *testing.T) {
1623
1621
// Sending logs using the client.
1624
1622
err = splunkClient .pushLogData (context .Background (), logs )
1625
1623
require .False (t , consumererror .IsPermanent (err ), "Expecting non-permanent error" )
1626
- require .EqualError (t , err , "HTTP \" http://splunk \" 500 \" Internal Server Error\" " )
1624
+ require .EqualError (t , err , "HTTP \" /v1/endpoint \" 500 \" Internal Server Error\" " )
1627
1625
// The returned error should not contain the response body responseBody.
1628
1626
assert .NotContains (t , err .Error (), responseBody )
1629
1627
}
0 commit comments