Fix tests

This commit is contained in:
Christian Richter
2022-03-10 15:35:44 +01:00
parent 59eaf7c1b8
commit 3a34e64dde
13 changed files with 30 additions and 30 deletions

View File

@@ -29,7 +29,7 @@ if err != nil {
}
replacer := strings.NewReplacer(
"github.com/owncloud/ocis/", "",
"/pkg/config", "",
"/pkg/config/defaults", "",
)
var fields []ConfigField
var targetFile *os.File

View File

@@ -15,7 +15,7 @@ import (
. "github.com/onsi/gomega"
libregraph "github.com/owncloud/libre-graph-api-go"
"github.com/owncloud/ocis/graph/mocks"
"github.com/owncloud/ocis/graph/pkg/config"
"github.com/owncloud/ocis/graph/pkg/config/defaults"
service "github.com/owncloud/ocis/graph/pkg/service/v0"
"github.com/owncloud/ocis/graph/pkg/service/v0/errorcode"
"github.com/stretchr/testify/mock"
@@ -34,7 +34,7 @@ var _ = Describe("Graph", func() {
gatewayClient = &mocks.GatewayClient{}
httpClient = &mocks.HTTPClient{}
svc = service.NewService(
service.Config(config.DefaultConfig()),
service.Config(defaults.DefaultConfig()),
service.WithGatewayClient(gatewayClient),
service.WithHTTPClient(httpClient),
)

View File

@@ -4,11 +4,11 @@ import (
"os"
"github.com/owncloud/ocis/nats/pkg/command"
"github.com/owncloud/ocis/nats/pkg/config"
"github.com/owncloud/ocis/nats/pkg/config/defaults"
)
func main() {
if err := command.Execute(config.DefaultConfig()); err != nil {
if err := command.Execute(defaults.DefaultConfig()); err != nil {
os.Exit(1)
}
}

View File

@@ -4,11 +4,11 @@ import (
"os"
"github.com/owncloud/ocis/notifications/pkg/command"
"github.com/owncloud/ocis/notifications/pkg/config"
"github.com/owncloud/ocis/notifications/pkg/config/defaults"
)
func main() {
if err := command.Execute(config.DefaultConfig()); err != nil {
if err := command.Execute(defaults.DefaultConfig()); err != nil {
os.Exit(1)
}
}

View File

@@ -4,11 +4,11 @@ import (
"os"
"github.com/owncloud/ocis/ocs/pkg/command"
"github.com/owncloud/ocis/ocs/pkg/config"
"github.com/owncloud/ocis/ocs/pkg/config/defaults"
)
func main() {
if err := command.Execute(config.DefaultConfig()); err != nil {
if err := command.Execute(defaults.DefaultConfig()); err != nil {
os.Exit(1)
}
}

View File

@@ -4,11 +4,11 @@ import (
"os"
"github.com/owncloud/ocis/proxy/pkg/command"
"github.com/owncloud/ocis/proxy/pkg/config"
"github.com/owncloud/ocis/proxy/pkg/config/defaults"
)
func main() {
if err := command.Execute(config.DefaultConfig()); err != nil {
if err := command.Execute(defaults.DefaultConfig()); err != nil {
os.Exit(1)
}
}

View File

@@ -4,7 +4,7 @@ import (
"net/url"
"testing"
"github.com/owncloud/ocis/proxy/pkg/config"
"github.com/owncloud/ocis/proxy/pkg/config/defaults"
)
type matchertest struct {
@@ -13,8 +13,8 @@ type matchertest struct {
}
func TestPrefixRouteMatcher(t *testing.T) {
cfg := config.DefaultConfig()
cfg.Policies = config.DefaultPolicies()
cfg := defaults.DefaultConfig()
cfg.Policies = defaults.DefaultPolicies()
p := NewMultiHostReverseProxy(Config(cfg))
table := []matchertest{
@@ -33,8 +33,8 @@ func TestPrefixRouteMatcher(t *testing.T) {
}
func TestQueryRouteMatcher(t *testing.T) {
cfg := config.DefaultConfig()
cfg.Policies = config.DefaultPolicies()
cfg := defaults.DefaultConfig()
cfg.Policies = defaults.DefaultPolicies()
p := NewMultiHostReverseProxy(Config(cfg))
table := []matchertest{
@@ -61,8 +61,8 @@ func TestQueryRouteMatcher(t *testing.T) {
}
func TestRegexRouteMatcher(t *testing.T) {
cfg := config.DefaultConfig()
cfg.Policies = config.DefaultPolicies()
cfg := defaults.DefaultConfig()
cfg.Policies = defaults.DefaultPolicies()
p := NewMultiHostReverseProxy(Config(cfg))
table := []matchertest{

View File

@@ -4,11 +4,11 @@ import (
"os"
"github.com/owncloud/ocis/settings/pkg/command"
"github.com/owncloud/ocis/settings/pkg/config"
"github.com/owncloud/ocis/settings/pkg/config/defaults"
)
func main() {
if err := command.Execute(config.DefaultConfig()); err != nil {
if err := command.Execute(defaults.DefaultConfig()); err != nil {
os.Exit(1)
}
}

View File

@@ -4,11 +4,11 @@ import (
"os"
"github.com/owncloud/ocis/storage/pkg/command"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/owncloud/ocis/storage/pkg/config/defaults"
)
func main() {
if err := command.Execute(config.DefaultConfig()); err != nil {
if err := command.Execute(defaults.DefaultConfig()); err != nil {
os.Exit(1)
}
}

View File

@@ -4,11 +4,11 @@ import (
"os"
"github.com/owncloud/ocis/store/pkg/command"
"github.com/owncloud/ocis/store/pkg/config"
"github.com/owncloud/ocis/store/pkg/config/defaults"
)
func main() {
if err := command.Execute(config.DefaultConfig()); err != nil {
if err := command.Execute(defaults.DefaultConfig()); err != nil {
os.Exit(1)
}
}

View File

@@ -4,11 +4,11 @@ import (
"os"
"github.com/owncloud/ocis/thumbnails/pkg/command"
"github.com/owncloud/ocis/thumbnails/pkg/config"
"github.com/owncloud/ocis/thumbnails/pkg/config/defaults"
)
func main() {
if err := command.Execute(config.DefaultConfig()); err != nil {
if err := command.Execute(defaults.DefaultConfig()); err != nil {
os.Exit(1)
}
}

View File

@@ -4,11 +4,11 @@ import (
"os"
"github.com/owncloud/ocis/web/pkg/command"
"github.com/owncloud/ocis/web/pkg/config"
"github.com/owncloud/ocis/web/pkg/config/defaults"
)
func main() {
if err := command.Execute(config.DefaultConfig()); err != nil {
if err := command.Execute(defaults.DefaultConfig()); err != nil {
os.Exit(1)
}
}

View File

@@ -4,11 +4,11 @@ import (
"os"
"github.com/owncloud/ocis/webdav/pkg/command"
"github.com/owncloud/ocis/webdav/pkg/config"
"github.com/owncloud/ocis/webdav/pkg/config/defaults"
)
func main() {
if err := command.Execute(config.DefaultConfig()); err != nil {
if err := command.Execute(defaults.DefaultConfig()); err != nil {
os.Exit(1)
}
}