diff --git a/src/internal/connector/exchange/exchange_data_collection.go b/src/internal/connector/exchange/exchange_data_collection.go index f46f002c3..73350623b 100644 --- a/src/internal/connector/exchange/exchange_data_collection.go +++ b/src/internal/connector/exchange/exchange_data_collection.go @@ -67,15 +67,6 @@ func (eoc *Collection) PopulateCollection(newData *Stream) { eoc.data <- newData } -// FinishPopulation is used to indicate data population of the collection is complete -// TODO: This should be an internal method once we move the message retrieval logic into `ExchangeDataCollection` -// TODO: This will be removed as the channel will be filled from calls from exchange.Collection -func (eoc *Collection) FinishPopulation() { - if eoc.data != nil { - close(eoc.data) - } -} - // NOTE: Refactor has not happened moving into folders // populateFromTaskList async call to fill DataCollection via channel implementation func PopulateFromTaskList( @@ -117,8 +108,7 @@ func PopulateFromTaskList( break } } - - edc.FinishPopulation() + close(edc.data) attemptedItems += len(tasks) } diff --git a/src/internal/connector/graph_connector_test.go b/src/internal/connector/graph_connector_test.go index 872f44b03..444d33e8f 100644 --- a/src/internal/connector/graph_connector_test.go +++ b/src/internal/connector/graph_connector_test.go @@ -76,6 +76,7 @@ func (suite *GraphConnectorIntegrationSuite) TestGraphConnector_ExchangeDataColl suite.Greater(len(exchangeData.FullPath()), 2) } +//TODO add mockdata for this test... Will not pass as is func (suite *GraphConnectorIntegrationSuite) TestGraphConnector_restoreMessages() { user := "TEST_GRAPH_USER" // user.GetId() file := "TEST_GRAPH_FILE" // Test file should be sent or received by the user @@ -92,7 +93,7 @@ func (suite *GraphConnectorIntegrationSuite) TestGraphConnector_restoreMessages( edc := exchange.NewCollection("tenant", []string{"tenantId", evs[user], mailCategory, "Inbox"}) edc.PopulateCollection(&ds) - edc.FinishPopulation() + //edc.FinishPopulation() err = suite.connector.RestoreMessages(context.Background(), []data.Collection{&edc}) assert.NoError(suite.T(), err) }