2021-02-11 23:48:19 +08:00
|
|
|
package service
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2023-01-24 13:43:13 +08:00
|
|
|
"github.com/stretchr/testify/assert"
|
2022-01-04 15:51:32 +08:00
|
|
|
"github.com/zeromicro/go-zero/core/logx"
|
2021-02-11 23:48:19 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestServiceConf(t *testing.T) {
|
|
|
|
c := ServiceConf{
|
|
|
|
Name: "foo",
|
|
|
|
Log: logx.LogConf{
|
|
|
|
Mode: "console",
|
|
|
|
},
|
|
|
|
Mode: "dev",
|
|
|
|
}
|
|
|
|
c.MustSetUp()
|
|
|
|
}
|
2023-01-24 13:43:13 +08:00
|
|
|
|
|
|
|
func TestServiceConfWithMetricsUrl(t *testing.T) {
|
|
|
|
c := ServiceConf{
|
|
|
|
Name: "foo",
|
|
|
|
Log: logx.LogConf{
|
|
|
|
Mode: "volume",
|
|
|
|
},
|
|
|
|
Mode: "dev",
|
|
|
|
MetricsUrl: "http://localhost:8080",
|
|
|
|
}
|
|
|
|
assert.NoError(t, c.SetUp())
|
|
|
|
}
|