diff --git a/internal/http/services/owncloud/ocdav/ocdav_blackbox_test.go b/internal/http/services/owncloud/ocdav/ocdav_blackbox_test.go index 7f339629eb8..a98c1c9aae9 100644 --- a/internal/http/services/owncloud/ocdav/ocdav_blackbox_test.go +++ b/internal/http/services/owncloud/ocdav/ocdav_blackbox_test.go @@ -21,6 +21,7 @@ import ( "context" "errors" "fmt" + "google.golang.org/grpc" "net/http" "net/http/httptest" "path" @@ -958,14 +959,20 @@ var _ = Describe("ocdav", func() { req.Header.Set(net.HeaderDestination, basePath+dstPath) req.Header.Set("Overwrite", "T") - client.On("GetPath", mock.Anything, mock.Anything).Return(&cs3storageprovider.GetPathResponse{ - Status: status.NewOK(ctx), - Path: "/file", - }, nil).Once() - client.On("GetPath", mock.Anything, mock.Anything).Return(&cs3storageprovider.GetPathResponse{ - Status: status.NewOK(ctx), - Path: "/dstFileName", - }, nil).Once() + client.On("GetPath", mock.Anything, mock.Anything).Return(func(ctx context.Context, req *cs3storageprovider.GetPathRequest, _ ...grpc.CallOption) (*cs3storageprovider.GetPathResponse, error) { + switch req.ResourceId.OpaqueId { + case "dstId": + return &cs3storageprovider.GetPathResponse{ + Status: status.NewOK(ctx), + Path: "/dstFileName", + }, nil + default: + return &cs3storageprovider.GetPathResponse{ + Status: status.NewOK(ctx), + Path: "/file", + }, nil + } + }) client.On("Stat", mock.Anything, mock.MatchedBy(func(req *cs3storageprovider.StatRequest) bool { return req.Ref.Path == mReq.Source.Path