@Test
fun validateForCreation return Unit if request is valid
() {
val scheduledTime = OffsetDateTime.now()
val configureStepRequest = ConfigureTwitterStepRequestFactory.create(
platform = Platform.TWITTER,
scheduledTime = scheduledTime,
)
val stepConfigs = listOf(StepConfigFactory.createStepConfigs(platform = Platform.LINKEDIN))
val campaign = CampaignFactory.create(
startDate = scheduledTime.minusDays(1),
endDate = scheduledTime.plusDays(1),
)
when
(campaignStepsRepository.getStep(defaultCampaignStep.stepId)).thenReturnObject(defaultCampaignStepV2)
when
(campaignRepository.getById(campaignId = defaultCampaignStep.campaignId)).thenReturnObject(campaign)
when
(stepConfigsRepository.getConfigsByStepId(stepId = defaultCampaignStep.stepId)).thenReturnObject(stepConfigs)
configureStepRequestValidator.validateForCreation(
campaignId = defaultCampaignStep.campaignId,
stepId = 1L,
configureStepRequest = configureStepRequest,
)
.shouldBeRight(Unit)
}