Files
core/http/handler/api/log_test.go
Jan Stabenow 9c0b535199 Add v16.7.2
2022-05-13 19:26:45 +02:00

29 lines
487 B
Go

package api
import (
"net/http"
"testing"
"github.com/datarhei/core/http/api"
"github.com/datarhei/core/http/mock"
"github.com/labstack/echo/v4"
)
func getDummyLogRouter() *echo.Echo {
router := mock.DummyEcho()
handler := NewLog(nil)
router.Add("GET", "/", handler.Log)
return router
}
func TestLog(t *testing.T) {
router := getDummyLogRouter()
response := mock.Request(t, http.StatusOK, router, "GET", "/", nil)
mock.Validate(t, []api.LogEvent{}, response.Data)
}