Skip to content

Commit

Permalink
Updated unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and [email protected] committed Nov 27, 2024
1 parent 303ef11 commit 1f7af98
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,31 @@ void onboardingsOrchestratorForApproveGpu() {
.updateOnboardingStatus(onboarding.getId(), OnboardingStatus.TOBEVALIDATED);
}

@Test
void onboardingsOrchestratorForApproveGpuWhenIsPending() {
Onboarding onboarding = new Onboarding();
onboarding.setId("onboardingId");
onboarding.setStatus(OnboardingStatus.PENDING);
onboarding.setInstitution(new Institution());
onboarding.setWorkflowType(WorkflowType.FOR_APPROVE_GPU);

TaskOrchestrationContext orchestrationContext = mockTaskOrchestrationContext(onboarding);

function.onboardingsOrchestrator(orchestrationContext, executionContext);

ArgumentCaptor<String> captorActivity = ArgumentCaptor.forClass(String.class);
verify(orchestrationContext, times(5))
.callActivity(captorActivity.capture(), any(), any(), any());
assertEquals(CREATE_INSTITUTION_ACTIVITY, captorActivity.getAllValues().get(0));
assertEquals(CREATE_ONBOARDING_ACTIVITY, captorActivity.getAllValues().get(1));
assertEquals(CREATE_USERS_ACTIVITY, captorActivity.getAllValues().get(2));
assertEquals(STORE_ONBOARDING_ACTIVATEDAT, captorActivity.getAllValues().get(3));
assertEquals(SEND_MAIL_COMPLETION_ACTIVITY, captorActivity.getAllValues().get(4));

verify(service, times(1))
.updateOnboardingStatus(onboarding.getId(), OnboardingStatus.COMPLETED);
}

@Test
void onboardingsOrchestratorForApproveWhenToBeValidated() {
Onboarding onboarding = new Onboarding();
Expand Down

0 comments on commit 1f7af98

Please sign in to comment.