Skip to content

Commit

Permalink
DTSCCI-1527 - Updated Camunda test
Browse files Browse the repository at this point in the history
  • Loading branch information
guygrewal77 committed Jan 31, 2025
1 parent 7a9d4ac commit 4386d27
Showing 1 changed file with 15 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

import java.util.HashMap;
import java.util.Map;

import static org.assertj.core.api.Assertions.assertThat;
Expand Down Expand Up @@ -124,7 +125,7 @@ void shouldNotifyApplicantSolicitor_whenPastClaimDetailsNotificationDeadline() {

@ParameterizedTest
@ValueSource(strings = {"true", "false"})
void shouldNotifyAllParties_whenPastClaimDismissedDeadline(boolean has2RespondentSolicitors) {
void shouldNotifyAllParties_whenPastClaimDismissedDeadline() {
//assert process has started
assertFalse(processInstance.isEnded());

Expand All @@ -133,10 +134,7 @@ void shouldNotifyAllParties_whenPastClaimDismissedDeadline(boolean has2Responden

VariableMap variables = Variables.createVariables();
variables.putValue("flowState", "MAIN.CLAIM_DISMISSED_PAST_CLAIM_DISMISSED_DEADLINE");
variables.put("flowFlags", Map.of(
ONE_RESPONDENT_REPRESENTATIVE, !has2RespondentSolicitors,
TWO_RESPONDENT_REPRESENTATIVES, has2RespondentSolicitors,
GENERAL_APPLICATION_ENABLED, false));
variables.put("flowFlags", new HashMap<>());

//complete the start business process
ExternalTask startBusiness = assertNextExternalTask(START_BUSINESS_TOPIC);
Expand All @@ -148,33 +146,13 @@ void shouldNotifyAllParties_whenPastClaimDismissedDeadline(boolean has2Responden
variables
);

//complete the notification to respondent
ExternalTask respondentNotification = assertNextExternalTask(PROCESS_CASE_EVENT);
//complete the notification to 1v2 parties
ExternalTask oneVTwopartiesNotification = assertNextExternalTask(PROCESS_CASE_EVENT);
assertCompleteExternalTask(
respondentNotification,
oneVTwopartiesNotification,
PROCESS_CASE_EVENT,
"NOTIFY_RESPONDENT_SOLICITOR1_FOR_CLAIM_DISMISSED",
"ClaimDismissedNotifyRespondentSolicitor1"
);

if (has2RespondentSolicitors) {
//complete the notification to respondent 2
ExternalTask respondentTwoNotification = assertNextExternalTask(PROCESS_CASE_EVENT);
assertCompleteExternalTask(
respondentTwoNotification,
PROCESS_CASE_EVENT,
"NOTIFY_RESPONDENT_SOLICITOR2_FOR_CLAIM_DISMISSED",
"ClaimDismissedNotifyRespondentSolicitor2"
);
}

//complete the notification to applicant
ExternalTask applicantNotification = assertNextExternalTask(PROCESS_CASE_EVENT);
assertCompleteExternalTask(
applicantNotification,
PROCESS_CASE_EVENT,
"NOTIFY_APPLICANT_SOLICITOR1_FOR_CLAIM_DISMISSED",
"ClaimDismissedNotifyApplicantSolicitor1"
"NOTIFY_1V2_PARTIES_FOR_CLAIM_DISMISSED",
"ClaimDismissedNotify1V2Parties"
);

//complete the RPA notification
Expand Down Expand Up @@ -325,7 +303,7 @@ void shouldNotifyApplicantSolicitor_whenPastClaimDetailsNotificationDeadline_GAE

@ParameterizedTest
@ValueSource(strings = {"true", "false"})
void shouldNotifyAllParties_whenPastClaimDismissedDeadline_GAEnabled(boolean has2RespondentSolicitors) {
void shouldNotifyAllParties_whenPastClaimDismissedDeadline_GAEnabled() {
//assert process has started
assertFalse(processInstance.isEnded());

Expand All @@ -334,10 +312,7 @@ void shouldNotifyAllParties_whenPastClaimDismissedDeadline_GAEnabled(boolean has

VariableMap variables = Variables.createVariables();
variables.putValue("flowState", "MAIN.CLAIM_DISMISSED_PAST_CLAIM_DISMISSED_DEADLINE");
variables.put("flowFlags", Map.of(
ONE_RESPONDENT_REPRESENTATIVE, !has2RespondentSolicitors,
TWO_RESPONDENT_REPRESENTATIVES, has2RespondentSolicitors,
GENERAL_APPLICATION_ENABLED, true));
variables.put("flowFlags", new HashMap<>());

//complete the start business process
ExternalTask startBusiness = assertNextExternalTask(START_BUSINESS_TOPIC);
Expand All @@ -349,51 +324,13 @@ void shouldNotifyAllParties_whenPastClaimDismissedDeadline_GAEnabled(boolean has
variables
);

//Update General Application Status
ExternalTask updateApplicationStatus = assertNextExternalTask(PROCESS_CASE_EVENT);
assertCompleteExternalTask(
updateApplicationStatus,
PROCESS_CASE_EVENT,
TRIGGER_APPLICATION_CLOSURE,
APPLICATION_CLOSURE_ACTIVITY_ID
);

//Update Claim Details with General Application Status
ExternalTask updateClaimWithApplicationStatus = assertNextExternalTask(PROCESS_CASE_EVENT);
assertCompleteExternalTask(
updateClaimWithApplicationStatus,
PROCESS_CASE_EVENT,
APPLICATION_CLOSED_UPDATE_CLAIM,
APPLICATION_CLOSED_UPDATE_CLAIM_ACTIVITY_ID
);

//complete the notification to respondent
ExternalTask respondentNotification = assertNextExternalTask(PROCESS_CASE_EVENT);
assertCompleteExternalTask(
respondentNotification,
PROCESS_CASE_EVENT,
"NOTIFY_RESPONDENT_SOLICITOR1_FOR_CLAIM_DISMISSED",
"ClaimDismissedNotifyRespondentSolicitor1"
);

if (has2RespondentSolicitors) {
//complete the notification to respondent 2
ExternalTask respondentTwoNotification = assertNextExternalTask(PROCESS_CASE_EVENT);
assertCompleteExternalTask(
respondentTwoNotification,
PROCESS_CASE_EVENT,
"NOTIFY_RESPONDENT_SOLICITOR2_FOR_CLAIM_DISMISSED",
"ClaimDismissedNotifyRespondentSolicitor2"
);
}

//complete the notification to applicant
ExternalTask applicantNotification = assertNextExternalTask(PROCESS_CASE_EVENT);
//complete the notification to 1v2 parties
ExternalTask oneVTwoPartiesNotification = assertNextExternalTask(PROCESS_CASE_EVENT);
assertCompleteExternalTask(
applicantNotification,
oneVTwoPartiesNotification,
PROCESS_CASE_EVENT,
"NOTIFY_APPLICANT_SOLICITOR1_FOR_CLAIM_DISMISSED",
"ClaimDismissedNotifyApplicantSolicitor1"
"NOTIFY_1V2_PARTIES_FOR_CLAIM_DISMISSED",
"ClaimDismissedNotify1V2Parties"
);

//complete the RPA notification
Expand Down

0 comments on commit 4386d27

Please sign in to comment.