serviceconf_test.go 499 B

12345678910111213141516171819202122232425262728293031
  1. package service
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. "github.com/zeromicro/go-zero/core/logx"
  6. )
  7. func TestServiceConf(t *testing.T) {
  8. c := ServiceConf{
  9. Name: "foo",
  10. Log: logx.LogConf{
  11. Mode: "console",
  12. },
  13. Mode: "dev",
  14. }
  15. c.MustSetUp()
  16. }
  17. func TestServiceConfWithMetricsUrl(t *testing.T) {
  18. c := ServiceConf{
  19. Name: "foo",
  20. Log: logx.LogConf{
  21. Mode: "volume",
  22. },
  23. Mode: "dev",
  24. MetricsUrl: "http://localhost:8080",
  25. }
  26. assert.NoError(t, c.SetUp())
  27. }