Skip to content

Commit

Permalink
DTSCCI-570 adding case title om carm csv (#5118)
Browse files Browse the repository at this point in the history
* DTSCCI-570 adding case title om carm csv

* DTSCCI-570 adding case title om carm csv

* DTSCCI-570 adding case title om carm csv

* DTSCCI-570 adding case title om carm csv

---------

Co-authored-by: Ruban <[email protected]>
Co-authored-by: kdaHMCTS <[email protected]>
Co-authored-by: ed14537 <[email protected]>
  • Loading branch information
4 people authored Aug 6, 2024
1 parent 66deb1d commit 0fe8ca9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ private String generateCSVRow(String[] row) {

private String[] getCSVHeaders() {
return new String[] {"SITE_ID", "CASE_TYPE", "CHECK_LIST", "PARTY_STATUS", "CASE_NUMBER", "AMOUNT", "PARTY_TYPE",
"COMPANY_NAME", "CONTACT_NAME", "CONTACT_NUMBER", "CONTACT_EMAIL", "PILOT"};
"COMPANY_NAME", "CONTACT_NAME", "CONTACT_NUMBER", "CONTACT_EMAIL", "PILOT", "CASE_TITLE"};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,17 @@ private String getCSVContent(MediationParams params) {
getCsvCompanyName(data.getApplicant1()), applicantContactDetails.getApplicantContactName(params),
applicantContactDetails.getApplicantContactNumber(params),
applicantContactDetails.getApplicantContactEmail(params),
isPilot(data.getTotalClaimAmount())
isPilot(data.getTotalClaimAmount()),
data.getCaseNamePublic()
};

String[] respondentData = {
SITE_ID, CASE_TYPE, CHECK_LIST, PARTY_STATUS, data.getLegacyCaseReference(), totalClaimAmount, RESPONDENT,
getCsvCompanyName(data.getRespondent1()), defendantContactDetails.getDefendantContactName(params),
defendantContactDetails.getDefendantContactNumber(params),
defendantContactDetails.getDefendantContactEmail(params),
isPilot(data.getTotalClaimAmount())
isPilot(data.getTotalClaimAmount()),
data.getCaseNamePublic()
};
return generateCSVRow(claimantData)
+ generateCSVRow(respondentData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import static org.assertj.core.api.Assertions.assertThat;

@ExtendWith(MockitoExtension.class)
public class MediationCSVLipVLipServiceTest {
class MediationCSVLipVLipServiceTest {

@InjectMocks
private MediationCSVLipVLipService service;
Expand All @@ -37,9 +37,10 @@ public class MediationCSVLipVLipServiceTest {
private static final String ID = "123456789";
private static final String RESPONDENT = "2";
private static final String APPLICANT = "1";
private static final String CASE_TITLE = APPLICANT_INDIVIDUAL_FIRST_NAME.concat(" v ").concat(RESPONDENT_INDIVIDUAL_FIRST_NAME);

private void assertCSVContent(String result, String partyId, String partyName, String partyPhoneNumber, String partyEmailAddress) {
assertThat(result).contains(ID, partyId, partyName, partyPhoneNumber, partyEmailAddress, TOTAL_AMOUNT);
assertThat(result).contains(ID, partyId, partyName, partyPhoneNumber, partyEmailAddress, TOTAL_AMOUNT, CASE_TITLE);
}

private Party buildParty(Party.Type partyType, String companyName, String phoneNumber, String emailAddress,
Expand Down Expand Up @@ -68,6 +69,7 @@ private CaseData getCaseData(Party.Type partyType) {
.respondent1(buildParty(partyType, RESPONDENT_COMPANY_NAME, RESPONDENT_PHONE_NUMBER, RESPONDENT_EMAIL_ADDRESS,
RESPONDENT_INDIVIDUAL_FIRST_NAME, RESPONDENT_INDIVIDUAL_LAST_NAME,
RESPONDENT_SOLE_TRADER_FIRST_NAME, RESPONDENT_SOLE_TRADER_LAST_NAME, RESPONDENT_ORGANISATION_NAME))
.caseNamePublic(CASE_TITLE)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import static org.mockito.BDDMockito.given;

@ExtendWith(MockitoExtension.class)
public class MediationCSVLrvLipServiceTest {
class MediationCSVLrvLipServiceTest {

@InjectMocks
private MediationCSVLrvLipService service;
Expand All @@ -49,8 +49,10 @@ public class MediationCSVLrvLipServiceTest {
private static final String RESPONDENT = "2";
private static final String APPLICANT = "1";

private static final String CASE_TITLE = "Applicant company name".concat(" v ").concat(RESPONDENT_INDIVIDUAL_FIRST_NAME);

private void assertCSVContent(String result, String partyId, String partyName, String partyPhoneNumber, String partyEmailAddress) {
assertThat(result).contains(ID, partyId, partyName, partyPhoneNumber, partyEmailAddress, TOTAL_AMOUNT);
assertThat(result).contains(ID, partyId, partyName, partyPhoneNumber, partyEmailAddress, TOTAL_AMOUNT, CASE_TITLE);
}

private Party buildParty(Party.Type partyType, String companyName, String phoneNumber, String emailAddress,
Expand Down Expand Up @@ -82,6 +84,7 @@ private CaseData getCaseData(Party.Type partyType) {
.build())
.applicantSolicitor1ClaimStatementOfTruth(StatementOfTruth.builder().name(LR_COMPANY_NAME).build())
.applicantSolicitor1UserDetails(IdamUserDetails.builder().email(LR_COMPANY_EMAIL).build())
.caseNamePublic(CASE_TITLE)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import static org.mockito.BDDMockito.given;

@ExtendWith(MockitoExtension.class)
public class MediationCSVLrvLrServiceTest {
class MediationCSVLrvLrServiceTest {

@InjectMocks
private MediationCSVLrvLrService service;
Expand Down Expand Up @@ -97,6 +97,7 @@ private CaseData getCaseData(Party.Type partyType) {
.totalClaimAmount(new BigDecimal(TOTAL_AMOUNT))
.applicant1(applicantParty)
.respondent1(respondentParty)
.caseNamePublic(applicantParty.getPartyName().concat(" v ").concat(respondentParty.getPartyName()))
.applicant1OrganisationPolicy(OrganisationPolicy.builder()
.organisation(Organisation.builder().organisationID(APP_LR_ORG_ID).build())
.build())
Expand Down Expand Up @@ -124,7 +125,10 @@ void shouldContainApplicantLRContactDetails() {
String result = service.generateCSVContent(caseData);

// Then
assertContainsDetails(result, LR_APPLICANT_COMPANY_NAME, LR_APPLICANT_COMPANY_EMAIL, LR_APPLICANT_COMPANY_NUMBER);
assertContainsDetails(result, LR_APPLICANT_COMPANY_NAME,
LR_APPLICANT_COMPANY_EMAIL,
LR_APPLICANT_COMPANY_NUMBER,
APPLICANT_COMPANY_NAME.concat(" v ").concat(RESPONDENT_COMPANY_NAME));
}

@Test
Expand Down

0 comments on commit 0fe8ca9

Please sign in to comment.