From c06afe8265e6d6464a46787458c374f38860263a Mon Sep 17 00:00:00 2001 From: "pierpaolo.didato@emeal.nttdata.com" Date: Mon, 28 Oct 2024 16:41:32 +0100 Subject: [PATCH] Removed call to reject outdated onboardings function --- .../onboarding/workflow/WorkflowExecutor.java | 2 +- .../functions/OnboardingFunctionsTest.java | 38 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/apps/onboarding-functions/src/main/java/it/pagopa/selfcare/onboarding/workflow/WorkflowExecutor.java b/apps/onboarding-functions/src/main/java/it/pagopa/selfcare/onboarding/workflow/WorkflowExecutor.java index a2a11217..f82e3411 100644 --- a/apps/onboarding-functions/src/main/java/it/pagopa/selfcare/onboarding/workflow/WorkflowExecutor.java +++ b/apps/onboarding-functions/src/main/java/it/pagopa/selfcare/onboarding/workflow/WorkflowExecutor.java @@ -51,7 +51,7 @@ default String createInstitutionAndOnboarding(TaskOrchestrationContext ctx, Onbo ctx.callActivity(CREATE_ONBOARDING_ACTIVITY, onboardingWithInstitutionIdString, optionsRetry(), String.class).await(); ctx.callActivity(CREATE_USERS_ACTIVITY, onboardingWithInstitutionIdString, optionsRetry(), String.class).await(); ctx.callActivity(STORE_ONBOARDING_ACTIVATEDAT, onboardingWithInstitutionIdString, optionsRetry(), String.class).await(); - ctx.callActivity(REJECT_OUTDATED_ONBOARDINGS, onboardingString, optionsRetry(), String.class).await(); + //ctx.callActivity(REJECT_OUTDATED_ONBOARDINGS, onboardingString, optionsRetry(), String.class).await(); createTestEnvironmentsOnboarding(ctx, onboarding, onboardingWithInstitutionIdString); diff --git a/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/functions/OnboardingFunctionsTest.java b/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/functions/OnboardingFunctionsTest.java index 98899fea..73e27249 100644 --- a/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/functions/OnboardingFunctionsTest.java +++ b/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/functions/OnboardingFunctionsTest.java @@ -181,14 +181,14 @@ void onboardingOrchestratorContractRegistrationAggregator_Pending(){ function.onboardingsOrchestrator(orchestrationContext, executionContext); ArgumentCaptor captorActivity = ArgumentCaptor.forClass(String.class); - Mockito.verify(orchestrationContext, times(6)) + Mockito.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(REJECT_OUTDATED_ONBOARDINGS, captorActivity.getAllValues().get(4)); - assertEquals(SEND_MAIL_COMPLETION_ACTIVITY, captorActivity.getAllValues().get(5)); + //assertEquals(REJECT_OUTDATED_ONBOARDINGS, captorActivity.getAllValues().get(4)); + assertEquals(SEND_MAIL_COMPLETION_ACTIVITY, captorActivity.getAllValues().get(4)); Mockito.verify(orchestrationContext, times(3)) .callSubOrchestrator(eq(ONBOARDINGS_AGGREGATE_ORCHESTRATOR), any(), any()); @@ -329,14 +329,14 @@ void onboardingsOrchestratorConfirmation() { function.onboardingsOrchestrator(orchestrationContext, executionContext); ArgumentCaptor captorActivity = ArgumentCaptor.forClass(String.class); - verify(orchestrationContext, times(6)) + 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(REJECT_OUTDATED_ONBOARDINGS, captorActivity.getAllValues().get(4)); - assertEquals(SEND_MAIL_COMPLETION_ACTIVITY, captorActivity.getAllValues().get(5)); + //assertEquals(REJECT_OUTDATED_ONBOARDINGS, captorActivity.getAllValues().get(4)); + assertEquals(SEND_MAIL_COMPLETION_ACTIVITY, captorActivity.getAllValues().get(4)); verify(service, times(1)) .updateOnboardingStatus(onboarding.getId(), OnboardingStatus.COMPLETED); @@ -356,16 +356,16 @@ void onboardingsOrchestratorConfirmationWithTestProductIds() { function.onboardingsOrchestrator(orchestrationContext, executionContext); ArgumentCaptor captorActivity = ArgumentCaptor.forClass(String.class); - verify(orchestrationContext, times(8)) + verify(orchestrationContext, times(7)) .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(REJECT_OUTDATED_ONBOARDINGS, captorActivity.getAllValues().get(4)); - assertEquals(CREATE_ONBOARDING_ACTIVITY, captorActivity.getAllValues().get(5)); - assertEquals(CREATE_USERS_ACTIVITY, captorActivity.getAllValues().get(6)); - assertEquals(SEND_MAIL_COMPLETION_ACTIVITY, captorActivity.getAllValues().get(7)); + //assertEquals(REJECT_OUTDATED_ONBOARDINGS, captorActivity.getAllValues().get(4)); + assertEquals(CREATE_ONBOARDING_ACTIVITY, captorActivity.getAllValues().get(4)); + assertEquals(CREATE_USERS_ACTIVITY, captorActivity.getAllValues().get(5)); + assertEquals(SEND_MAIL_COMPLETION_ACTIVITY, captorActivity.getAllValues().get(6)); verify(service, times(1)) .updateOnboardingStatus(onboarding.getId(), OnboardingStatus.COMPLETED); @@ -490,13 +490,13 @@ void onboardingsOrchestratorImport() { function.onboardingsOrchestrator(orchestrationContext, executionContext); ArgumentCaptor captorActivity = ArgumentCaptor.forClass(String.class); - verify(orchestrationContext, times(5)) + verify(orchestrationContext, times(4)) .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(REJECT_OUTDATED_ONBOARDINGS, captorActivity.getAllValues().get(4)); + //assertEquals(REJECT_OUTDATED_ONBOARDINGS, captorActivity.getAllValues().get(4)); verify(service, times(1)) .updateOnboardingStatus(onboarding.getId(), OnboardingStatus.COMPLETED); @@ -560,14 +560,14 @@ void onboardingsOrchestratorForApprovePtWhenToBeValidated() { function.onboardingsOrchestrator(orchestrationContext, executionContext); ArgumentCaptor captorActivity = ArgumentCaptor.forClass(String.class); - verify(orchestrationContext, times(6)) + 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(REJECT_OUTDATED_ONBOARDINGS, captorActivity.getAllValues().get(4)); - assertEquals(SEND_MAIL_COMPLETION_ACTIVITY, captorActivity.getAllValues().get(5)); + //assertEquals(REJECT_OUTDATED_ONBOARDINGS, captorActivity.getAllValues().get(4)); + assertEquals(SEND_MAIL_COMPLETION_ACTIVITY, captorActivity.getAllValues().get(4)); verify(service, times(1)) .updateOnboardingStatus(onboarding.getId(), OnboardingStatus.COMPLETED); @@ -697,14 +697,14 @@ void onboardingCompletionOrchestrator() { function.onboardingsOrchestrator(orchestrationContext, executionContext); ArgumentCaptor captorActivity = ArgumentCaptor.forClass(String.class); - verify(orchestrationContext, times(6)) + 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(REJECT_OUTDATED_ONBOARDINGS, captorActivity.getAllValues().get(4)); - assertEquals(SEND_MAIL_COMPLETION_ACTIVITY, captorActivity.getAllValues().get(5)); + //assertEquals(REJECT_OUTDATED_ONBOARDINGS, captorActivity.getAllValues().get(4)); + assertEquals(SEND_MAIL_COMPLETION_ACTIVITY, captorActivity.getAllValues().get(4)); verify(service, times(1)) .updateOnboardingStatus(onboarding.getId(), OnboardingStatus.COMPLETED);