From a129ea6abef654d37c812d0e87f907dee9f4b67e Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Thu, 15 Sep 2022 10:42:00 +0200 Subject: [PATCH] fix unit tests --- services/graph/pkg/service/v0/drives.go | 2 +- services/graph/pkg/service/v0/graph_test.go | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/services/graph/pkg/service/v0/drives.go b/services/graph/pkg/service/v0/drives.go index 6d5f2ef507..8ff4c8c048 100644 --- a/services/graph/pkg/service/v0/drives.go +++ b/services/graph/pkg/service/v0/drives.go @@ -586,7 +586,7 @@ func (g Graph) cs3StorageSpaceToDrive(ctx context.Context, baseURL *url.URL, spa } webURL.Path = path.Join(webURL.Path, "f", storagespace.FormatResourceID(spaceRid)) - drive.Root.WebUrl = libregraph.PtrString(webURL.String()) + drive.WebUrl = libregraph.PtrString(webURL.String()) if space.Owner != nil && space.Owner.Id != nil { drive.Owner = &libregraph.IdentitySet{ diff --git a/services/graph/pkg/service/v0/graph_test.go b/services/graph/pkg/service/v0/graph_test.go index 0629e6ff67..fcd969c582 100644 --- a/services/graph/pkg/service/v0/graph_test.go +++ b/services/graph/pkg/service/v0/graph_test.go @@ -17,6 +17,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" libregraph "github.com/owncloud/libre-graph-api-go" + "github.com/owncloud/ocis/v2/ocis-pkg/shared" "github.com/owncloud/ocis/v2/services/graph/mocks" "github.com/owncloud/ocis/v2/services/graph/pkg/config" "github.com/owncloud/ocis/v2/services/graph/pkg/config/defaults" @@ -39,6 +40,8 @@ var _ = Describe("Graph", func() { cfg = defaults.FullDefaultConfig() cfg.Identity.LDAP.CACert = "" // skip the startup checks, we don't use LDAP at all in this tests cfg.TokenManager.JWTSecret = "loremipsum" + cfg.Commons = &shared.Commons{} + cfg.Commons.OcisURL = "https://ocis.test" gatewayClient = &mocks.GatewayClient{} eventsPublisher = mocks.Publisher{} @@ -108,7 +111,8 @@ var _ = Describe("Graph", func() { "root":{ "id":"pro-1$sameID", "webDavUrl":"https://localhost:9200/dav/spaces/pro-1$sameID" - } + }, + "webUrl": "https://ocis.test/f/pro-1$sameID" } ] } @@ -178,7 +182,8 @@ var _ = Describe("Graph", func() { "eTag":"101112131415", "id":"pro-1$asameID", "webDavUrl":"https://localhost:9200/dav/spaces/pro-1$asameID" - } + }, + "webUrl": "https://ocis.test/f/pro-1$asameID" }, { "driveAlias":"bspacetype/bspacename", @@ -189,7 +194,8 @@ var _ = Describe("Graph", func() { "eTag":"123456789", "id":"pro-1$bsameID", "webDavUrl":"https://localhost:9200/dav/spaces/pro-1$bsameID" - } + }, + "webUrl": "https://ocis.test/f/pro-1$bsameID" } ] }