From 9ab2d96451fe74d156ca1617e5f3a0f4605611b4 Mon Sep 17 00:00:00 2001 From: Danny Adams Date: Fri, 6 Jan 2023 16:18:56 -0500 Subject: [PATCH] Interface updated. MockGraphService struct removed from the helper_test.go --- .../sharepoint/data_collections_test.go | 16 +++++++++++++++- .../connector/sharepoint/helper_test.go | 18 ------------------ 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/internal/connector/sharepoint/data_collections_test.go b/src/internal/connector/sharepoint/data_collections_test.go index 9b391d1e8..c4f976e4d 100644 --- a/src/internal/connector/sharepoint/data_collections_test.go +++ b/src/internal/connector/sharepoint/data_collections_test.go @@ -3,6 +3,8 @@ package sharepoint import ( "testing" + absser "github.com/microsoft/kiota-abstractions-go/serialization" + msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go" "github.com/microsoftgraph/msgraph-sdk-go/models" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" @@ -41,6 +43,18 @@ type SharePointLibrariesSuite struct { suite.Suite } +func (suite *SharePointLibrariesSuite) Client() *msgraphsdk.GraphServiceClient { + return nil +} + +func (suite *SharePointLibrariesSuite) Adapter() *msgraphsdk.GraphRequestAdapter { + return nil +} + +func (suite *SharePointLibrariesSuite) Serialize(object absser.Parsable) ([]byte, error) { + return nil, nil +} + func TestSharePointLibrariesSuite(t *testing.T) { suite.Run(t, new(SharePointLibrariesSuite)) } @@ -92,7 +106,7 @@ func (suite *SharePointLibrariesSuite) TestUpdateCollections() { site, onedrive.SharePointSource, testFolderMatcher{test.scope}, - &MockGraphService{}, + suite, nil, control.Options{}) err := c.UpdateCollections(ctx, "driveID", test.items) diff --git a/src/internal/connector/sharepoint/helper_test.go b/src/internal/connector/sharepoint/helper_test.go index e716a5bae..749d355f1 100644 --- a/src/internal/connector/sharepoint/helper_test.go +++ b/src/internal/connector/sharepoint/helper_test.go @@ -3,7 +3,6 @@ package sharepoint import ( "testing" - msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go" "github.com/pkg/errors" "github.com/stretchr/testify/require" @@ -12,23 +11,6 @@ import ( "github.com/alcionai/corso/src/pkg/account" ) -// --------------------------------------------------------------------------- -// SharePoint Test Services -// --------------------------------------------------------------------------- -type MockGraphService struct{} - -//------------------------------------------------------------ -// Interface Functions: @See graph.Service -//------------------------------------------------------------ - -func (ms *MockGraphService) Client() *msgraphsdk.GraphServiceClient { - return nil -} - -func (ms *MockGraphService) Adapter() *msgraphsdk.GraphRequestAdapter { - return nil -} - // --------------------------------------------------------------------------- // Helper Functions // ---------------------------------------------------------------------------