Skip to content

Commit

Permalink
Refcator tests to address sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
venkat980 committed Oct 24, 2024
1 parent 0f33e52 commit 35529a5
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import java.time.LocalDate;
import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static uk.gov.justice.laa.crime.evidence.service.IncomeEvidenceValidationService.MISSING_OTHER_EVIDENCE_DESCRIPTION;

Expand Down Expand Up @@ -226,17 +225,19 @@ void givenExtraEvidenceWithDescription_whenCheckExtraEvidenceDescriptionsIsInvok
void givenIncomeExtraEvidenceWithNoDescription_whenCheckExtraEvidenceDescriptionsIsInvoked_thenExceptionIsThrown() {
ApiIncomeEvidence extraIncomeEvidence = TestModelDataBuilder.getIncomeEvidence(IncomeEvidenceType.OTHER_ADHOC);
extraIncomeEvidence.setDescription(null);
List<ApiIncomeEvidence> evidenceList = List.of(extraIncomeEvidence);
assertThrows(IllegalArgumentException.class,
() -> incomeEvidenceValidationService.checkExtraEvidenceDescriptions(List.of(extraIncomeEvidence)),
() -> incomeEvidenceValidationService.checkExtraEvidenceDescriptions(evidenceList),
MISSING_OTHER_EVIDENCE_DESCRIPTION);
}

@Test
void givenIncomeExtraEvidenceWithEmptyDescription_whenCheckExtraEvidenceDescriptionsIsInvoked_thenExceptionIsThrown() {
ApiIncomeEvidence extraIncomeEvidence = TestModelDataBuilder.getIncomeEvidence(IncomeEvidenceType.OTHER_BUSINESS);
extraIncomeEvidence.setDescription("");
List<ApiIncomeEvidence> evidenceList = List.of(extraIncomeEvidence);
assertThrows(IllegalArgumentException.class,
() -> incomeEvidenceValidationService.checkExtraEvidenceDescriptions(List.of(extraIncomeEvidence)),
() -> incomeEvidenceValidationService.checkExtraEvidenceDescriptions(evidenceList),
MISSING_OTHER_EVIDENCE_DESCRIPTION);
}

Expand Down

0 comments on commit 35529a5

Please sign in to comment.