mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
``` git ls-files \*.js \*.go \ | xargs sed -i '1i // SPDX-FileCopyrightText: 2022 Free Mobile\n// SPDX-License-Identifier: AGPL-3.0-only\n' git ls-files \*.vue \ | xargs sed -i '1i <!-- SPDX-FileCopyrightText: 2022 Free Mobile -->\n<!-- SPDX-License-Identifier: AGPL-3.0-only -->\n' ```
44 lines
1.0 KiB
Go
44 lines
1.0 KiB
Go
// SPDX-FileCopyrightText: 2022 Free Mobile
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
//go:build !release
|
|
|
|
package console
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/benbjohnson/clock"
|
|
|
|
"akvorado/common/clickhousedb"
|
|
"akvorado/common/clickhousedb/mocks"
|
|
"akvorado/common/daemon"
|
|
"akvorado/common/helpers"
|
|
"akvorado/common/http"
|
|
"akvorado/common/reporter"
|
|
"akvorado/console/authentication"
|
|
"akvorado/console/database"
|
|
)
|
|
|
|
// NewMock instantiantes a new authentication component
|
|
func NewMock(t *testing.T, config Configuration) (*Component, *http.Component, *mocks.MockConn, *clock.Mock) {
|
|
t.Helper()
|
|
r := reporter.NewMock(t)
|
|
h := http.NewMock(t, r)
|
|
ch, mockConn := clickhousedb.NewMock(t, r)
|
|
mockClock := clock.NewMock()
|
|
c, err := New(r, config, Dependencies{
|
|
Daemon: daemon.NewMock(t),
|
|
HTTP: h,
|
|
ClickHouseDB: ch,
|
|
Clock: mockClock,
|
|
Auth: authentication.NewMock(t, r),
|
|
Database: database.NewMock(t, r),
|
|
})
|
|
if err != nil {
|
|
t.Fatalf("New() error:\n%+v", err)
|
|
}
|
|
helpers.StartStop(t, c)
|
|
return c, h, mockConn, mockClock
|
|
}
|