console: turn authentication into a proper component

This commit is contained in:
Vincent Bernat
2022-06-09 19:55:57 +02:00
parent 9e620f2c91
commit b65d78ab1b
13 changed files with 100 additions and 197 deletions

View File

@@ -8,11 +8,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/golang/mock/gomock"
"akvorado/common/clickhousedb"
"akvorado/common/daemon"
"akvorado/common/helpers"
"akvorado/common/http"
"akvorado/common/reporter"
)
func TestGraphQuerySQL(t *testing.T) {
@@ -144,17 +140,7 @@ ORDER BY time`,
}
func TestGraphHandler(t *testing.T) {
r := reporter.NewMock(t)
ch, mockConn := clickhousedb.NewMock(t, r)
h := http.NewMock(t, r)
c, err := New(r, DefaultConfiguration(), Dependencies{
Daemon: daemon.NewMock(t),
HTTP: h,
ClickHouseDB: ch,
})
if err != nil {
t.Fatalf("New() error:\n%+v", err)
}
c, h, mockConn, _ := NewMock(t, DefaultConfiguration())
helpers.StartStop(t, c)
base := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)