Commit a611790f authored by Slawek Figiel's avatar Slawek Figiel
Browse files

[#682] Move db-related mocks to separate module

parent c5162416
......@@ -4,7 +4,7 @@ import (
"testing"
"github.com/stretchr/testify/require"
storktest "isc.org/stork/server/test"
storktest "isc.org/stork/server/test/dbmodel"
)
// nolint:gochecknoglobals
......
......@@ -11,7 +11,7 @@ import (
agentapi "isc.org/stork/api"
keactrl "isc.org/stork/appctrl/kea"
dbmodel "isc.org/stork/server/database/model"
storktest "isc.org/stork/server/test"
storktest "isc.org/stork/server/test/dbmodel"
)
// makeAccessPoint is an utility to make single element app access point slice.
......
......@@ -9,7 +9,7 @@ import (
agentcommtest "isc.org/stork/server/agentcomm/test"
dbmodel "isc.org/stork/server/database/model"
dbtest "isc.org/stork/server/database/test"
storktest "isc.org/stork/server/test"
storktest "isc.org/stork/server/test/dbmodel"
)
// Named statistics-channel response.
......
......@@ -8,7 +8,7 @@ import (
agentcommtest "isc.org/stork/server/agentcomm/test"
dbmodel "isc.org/stork/server/database/model"
dbtest "isc.org/stork/server/database/test"
storktest "isc.org/stork/server/test"
storktest "isc.org/stork/server/test/dbmodel"
)
// Check creating and shutting down StatsPuller.
......
......@@ -9,7 +9,7 @@ import (
agentcommtest "isc.org/stork/server/agentcomm/test"
dbmodel "isc.org/stork/server/database/model"
dbtest "isc.org/stork/server/database/test"
storktest "isc.org/stork/server/test"
storktest "isc.org/stork/server/test/dbmodel"
)
// Kea servers' response to config-get command from CA. The argument indicates if
......
......@@ -14,7 +14,7 @@ import (
"isc.org/stork/server/configreview"
dbmodel "isc.org/stork/server/database/model"
dbtest "isc.org/stork/server/database/test"
storktest "isc.org/stork/server/test"
storktest "isc.org/stork/server/test/dbmodel"
)
// Returns test Kea configuration including multiple IPv4 subnets.
......
......@@ -9,7 +9,7 @@ import (
agentcommtest "isc.org/stork/server/agentcomm/test"
dbmodel "isc.org/stork/server/database/model"
dbtest "isc.org/stork/server/database/test"
storktest "isc.org/stork/server/test"
storktest "isc.org/stork/server/test/dbmodel"
)
// Generates a response to the status-get command including two status
......
......@@ -10,7 +10,7 @@ import (
dbops "isc.org/stork/server/database"
dbmodel "isc.org/stork/server/database/model"
dbtest "isc.org/stork/server/database/test"
storktest "isc.org/stork/server/test"
storktest "isc.org/stork/server/test/dbmodel"
)
// Creates an app instance used in the tests. The index value should be incremented
......
......@@ -9,7 +9,7 @@ import (
kea "isc.org/stork/server/apps/kea"
dbmodel "isc.org/stork/server/database/model"
dbtest "isc.org/stork/server/database/test"
storktest "isc.org/stork/server/test"
storktest "isc.org/stork/server/test/dbmodel"
)
// Check creating and shutting down StatePuller.
......
......@@ -7,7 +7,7 @@ import (
"github.com/pkg/errors"
"github.com/stretchr/testify/require"
"isc.org/stork/server/dumper/dump"
storktest "isc.org/stork/server/test"
storktest "isc.org/stork/server/test/dbmodel"
)
// Test that the execution summary is properly constructed.
......
......@@ -8,7 +8,7 @@ import (
"isc.org/stork/server/agentcomm"
dbmodel "isc.org/stork/server/database/model"
dbtest "isc.org/stork/server/database/test"
storktest "isc.org/stork/server/test"
storktest "isc.org/stork/server/test/dbmodel"
)
// Test that the factory creates proper, unique dump instances.
......
......@@ -11,7 +11,7 @@ import (
dbmodel "isc.org/stork/server/database/model"
dbtest "isc.org/stork/server/database/test"
"isc.org/stork/server/dumper/dump"
storktest "isc.org/stork/server/test"
storktest "isc.org/stork/server/test/dbmodel"
storkutil "isc.org/stork/util"
)
......
......@@ -11,7 +11,7 @@ import (
dbmodel "isc.org/stork/server/database/model"
dbtest "isc.org/stork/server/database/test"
"isc.org/stork/server/gen/restapi/operations/services"
storktest "isc.org/stork/server/test"
storktest "isc.org/stork/server/test/dbmodel"
)
// Test that GetDaemonConfig works for Kea daemon with assigned configuration.
......
......@@ -27,7 +27,7 @@ import (
dhcp "isc.org/stork/server/gen/restapi/operations/d_h_c_p"
"isc.org/stork/server/gen/restapi/operations/general"
"isc.org/stork/server/gen/restapi/operations/services"
storktest "isc.org/stork/server/test"
storktest "isc.org/stork/server/test/dbmodel"
storkutil "isc.org/stork/util"
)
......
......@@ -12,6 +12,7 @@ import (
dbsession "isc.org/stork/server/database/session"
dbtest "isc.org/stork/server/database/test"
storktest "isc.org/stork/server/test"
storktestdbmodel "isc.org/stork/server/test/dbmodel"
)
// Check if fileServerMiddleware works and handles requests correctly.
......@@ -67,7 +68,7 @@ func TestSSEMiddleware(t *testing.T) {
requestReceived = true
})
fec := &storktest.FakeEventCenter{}
fec := &storktestdbmodel.FakeEventCenter{}
handler := sseMiddleware(nextHandler, fec)
......
......@@ -8,6 +8,7 @@ import (
apps "isc.org/stork/server/apps"
dbtest "isc.org/stork/server/database/test"
storktest "isc.org/stork/server/test"
storktestdbmodel "isc.org/stork/server/test/dbmodel"
)
// Tests instantiating RestAPI.
......@@ -19,8 +20,8 @@ func TestNewRestAPI(t *testing.T) {
// under test.
settings := &RestAPISettings{}
agents := agentcommtest.NewFakeAgents(nil, nil)
eventcenter := &storktest.FakeEventCenter{}
dispatcher := &storktest.FakeDispatcher{}
eventcenter := &storktestdbmodel.FakeEventCenter{}
dispatcher := &storktestdbmodel.FakeDispatcher{}
pullers := &apps.Pullers{}
collector := storktest.NewFakeMetricsCollector()
......
......@@ -10,7 +10,7 @@ import (
dbtest "isc.org/stork/server/database/test"
"isc.org/stork/server/gen/models"
"isc.org/stork/server/gen/restapi/operations/settings"
storktest "isc.org/stork/server/test"
storktest "isc.org/stork/server/test/dbmodel"
)
// Check getting and setting global settings via rest api functions.
......
......@@ -9,7 +9,7 @@ import (
dbmodel "isc.org/stork/server/database/model"
dbtest "isc.org/stork/server/database/test"
dhcp "isc.org/stork/server/gen/restapi/operations/d_h_c_p"
storktest "isc.org/stork/server/test"
storktest "isc.org/stork/server/test/dbmodel"
)
// Check getting subnets via rest api functions.
......
package storktest
package storktestdbmodel
import (
"isc.org/stork/server/configreview"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment