Created
February 26, 2021 12:59
-
-
Save spirosoik/3074bd95aeb7070a6276b8518bb82028 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (s *eventTestSuite) TestAwSuccesfullyDeployedButCrmFailed() { | |
//given | |
s.asAnonymousUser().signup().and().deployLensesAWS() | |
// when | |
s.deployedSuccesfullyAWS() | |
// then | |
s.handleLeadCrmIntegrationError() | |
} | |
func (s *eventTestSuite) deployedSuccesfullyAWS() *eventTestSuite { | |
s.crmClient.createLead = func(req pardot.LeadRequest) (int64, error) { | |
return s.crmID, nil | |
} | |
s.crmClient.udpateQualification = func(req pardot.LeadUpdateQualificationRequest) error { | |
return nil | |
} | |
s.crmClient.updateAWSActivityEvent = func(crmID int64) error { | |
return nil | |
} | |
s.crmClient.updateAWSDeploymentState = func(crmID int64, state string) error { | |
return errors.New("Failed to update CRM") | |
} | |
s.err = s.eventHandler.HandleEvent(context.Background(), testutil.EventToSQSEvent(leads.AwsDeploymentStateChangedEvent{ | |
BaseEvent: leads.BaseEvent{ | |
UserURN: s.userURN, | |
}, | |
State: leads.DeploymentCreating, | |
})) | |
return s | |
} | |
func (s *eventTestSuite) handleLeadCrmIntegrationError() { | |
assert.Error(s.T(), s.err) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment