use standard user env var in graphconnector tests (#537)

This commit is contained in:
Keepers 2022-08-12 12:40:32 -06:00 committed by GitHub
parent c052536094
commit 6464a66b46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,13 +163,12 @@ func (suite *GraphConnectorIntegrationSuite) TestGraphConnector_TestContactSeque
// TestGraphConnector_restoreMessages uses mock data to ensure GraphConnector // TestGraphConnector_restoreMessages uses mock data to ensure GraphConnector
// is able to restore a messageable item to a Mailbox. // is able to restore a messageable item to a Mailbox.
func (suite *GraphConnectorIntegrationSuite) TestGraphConnector_restoreMessages() { func (suite *GraphConnectorIntegrationSuite) TestGraphConnector_restoreMessages() {
user := "TEST_GRAPH_USER" // user.GetId() user := tester.M365UserID(suite.T())
evs, err := tester.GetRequiredEnvVars(user) if len(user) == 0 {
if err != nil { suite.T().Skip("Environment not configured: missing m365 test user")
suite.T().Skipf("Environment not configured: %v\n", err)
} }
mdc := mockconnector.NewMockExchangeCollection([]string{"tenant", evs[user], mailCategory, "Inbox"}, 1) mdc := mockconnector.NewMockExchangeCollection([]string{"tenant", user, mailCategory, "Inbox"}, 1)
err = suite.connector.RestoreMessages(context.Background(), []data.Collection{mdc}) err := suite.connector.RestoreMessages(context.Background(), []data.Collection{mdc})
assert.NoError(suite.T(), err) assert.NoError(suite.T(), err)
} }