add test for Endpoint of kindJaegerUdp

This commit is contained in:
xiandong 2023-02-17 13:35:58 +08:00 committed by Kevin Wan
parent b6bedcd522
commit ebc425b797

22
core/trace/config_test.go Normal file
View File

@ -0,0 +1,22 @@
package trace
import (
"github.com/stretchr/testify/assert"
"github.com/zeromicro/go-zero/core/logx"
"testing"
)
func TestConfig_getEndpointHost(t *testing.T) {
logx.Disable()
c1 := Config{
Endpoint: "http://localhost:14268/api/traces",
}
c2 := Config{
Endpoint: "localhost:6831",
}
assert.NotEqual(t, "localhost", c1.getEndpointHost())
assert.NotEqual(t, "14268", c1.getEndpointPort())
assert.Equal(t, "localhost", c2.getEndpointHost())
assert.Equal(t, "6831", c2.getEndpointPort())
}