Skip to content

Commit

Permalink
[PPANTT-49] feat: updated IbanServiceTest.java, TestUtil
Browse files Browse the repository at this point in the history
  • Loading branch information
alessio-cialini committed Aug 27, 2024
1 parent 05bc17f commit 7b5f9d5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import it.gov.pagopa.apiconfig.selfcareintegration.repository.ExtendedIbanMasterRepository;
import it.gov.pagopa.apiconfig.starter.entity.IbanMaster;
import it.gov.pagopa.apiconfig.selfcareintegration.util.TestUtil;
import it.gov.pagopa.apiconfig.starter.entity.Pa;
import org.assertj.core.util.Lists;
import org.json.JSONException;
import org.junit.jupiter.api.BeforeEach;
Expand Down Expand Up @@ -89,7 +90,21 @@ void getIbans_multipleCIOnlyOneExists_200() throws IOException, JSONException {
void getIbans_multipleCI_200() throws IOException, JSONException {

List<String> ciList = List.of("168480242", "99999999999");
Page<IbanMaster> page = TestUtil.mockPage(Lists.newArrayList(getMockIbanMaster2()), 10, 0);
List<IbanMaster> ibanMaster = getMockIbanMaster2();
Pa pa = Pa.builder()
.objId(100L)
.idDominio("99999999999")
.enabled(true)
.ragioneSociale("Comune di Ventimiglia")
.indirizzoDomicilioFiscale("Via Roma 1")
.capDomicilioFiscale("23456")
.siglaProvinciaDomicilioFiscale("VE")
.comuneDomicilioFiscale("Bassano del Grappa")
.denominazioneDomicilioFiscale("Via Roma 1")
.description("Bassano del Grappa")
.build();
ibanMaster.get(0).getIban().setPa(pa);
Page<IbanMaster> page = TestUtil.mockPage(Lists.newArrayList(ibanMaster), 10, 0);

when(extendedIbanMasterRepository.findAllByPa_idDominioIn(anyList(), any(Pageable.class)))
.thenReturn(page);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ public static List<IbanMaster> getMockIbanMaster2() {
.objId(10L)
.iban("IT01X02933019297465283757")
.dueDate(Timestamp.valueOf("2035-12-31 23:59:59.999"))
.pa(pa)
.build()
)
.ibanAttributesMasters(List.of())
Expand All @@ -357,6 +358,7 @@ public static List<IbanMaster> getMockIbanMaster2() {
.objId(11L)
.iban("IT01X02933019297465283758")
.dueDate(Timestamp.valueOf("2035-12-31 23:59:59.999"))
.pa(pa)
.build()
)
.ibanAttributesMasters(List.of(
Expand Down

0 comments on commit 7b5f9d5

Please sign in to comment.