diff --git a/pkg/infrastructure/logs/formatter_test.go b/pkg/infrastructure/logs/formatter_test.go index 7ba9237b..a97765ac 100644 --- a/pkg/infrastructure/logs/formatter_test.go +++ b/pkg/infrastructure/logs/formatter_test.go @@ -92,4 +92,4 @@ func TestPatternLogFormatter(t *testing.T) { if got != want { t.Errorf("want %s, got %s", want, got) } -} \ No newline at end of file +} diff --git a/pkg/infrastructure/logs/jianliao_test.go b/pkg/infrastructure/logs/jianliao_test.go index eb0ac9e1..a1b2d076 100644 --- a/pkg/infrastructure/logs/jianliao_test.go +++ b/pkg/infrastructure/logs/jianliao_test.go @@ -15,41 +15,12 @@ package logs import ( - "net/http" "testing" "time" "github.com/stretchr/testify/assert" ) -type TestHttpHandler struct { -} - -func (t *TestHttpHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { - writer.Write([]byte("coming")) -} - -func TestJLWriter_WriteMsg(t *testing.T) { - // start sever - - http.Handle("/", &TestHttpHandler{}) - go http.ListenAndServe(":12124", nil) - - jl := newJLWriter() - jl.Init(`{ -"webhookurl":"http://localhost:12124/hello", -"redirecturl":"nil", -"imageurl":"a" -}`) - err := jl.WriteMsg(&LogMsg{ - Msg: "world", - }) - - jl.Flush() - jl.Destroy() - assert.Nil(t, err) -} - func TestJLWriter_Format(t *testing.T) { lg := &LogMsg{ Level: LevelDebug,