Skip to content

Commit

Permalink
PAGOPA-1153 adding junit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoRuzzier committed Aug 22, 2023
1 parent 260733b commit 6da93ff
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/java/it/gov/pagopa/afm/utils/ImportCDIHandlerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,20 @@ void executePaymentMethodPO()
assertEquals("PSP", requests.get(0).getTouchpoint());
}

@Test
void verifyPSPBusinessName()
throws IOException,
SecurityException,
IllegalArgumentException {
// precondition
CDI cdi = TestUtil.readModelFromFile("cdi/cdi_ragione_sociale.json", CDI.class);

List<BundleRequest> requests = cdiService.createBundlesByCDI(cdi);

assertEquals(1, requests.size());
assertEquals("PSP_RAGIONE_SOCIALE", requests.get(0).getPspBusinessName());
}

/*
@Test
void executeFailed()
Expand Down
27 changes: 27 additions & 0 deletions src/test/resources/cdi/cdi_ragione_sociale.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"idPsp": "string",
"idCdi": "string",
"abi": "string",
"digitalStamp": true,
"validityDateFrom": "2022-12-14",
"pspBusinessName": "PSP_RAGIONE_SOCIALE",
"details": [
{
"idBrokerPsp": "string",
"idChannel": "string",
"name": "string",
"description": "string",
"paymentType": "PO",
"channelApp": false,
"channelCardsCart": false,
"serviceAmount": [
{
"paymentAmount": 1000,
"minPaymentAmount": 500,
"maxPaymentAmount": 1500
}
]
}
],
"cdiStatus": "NEW"
}

0 comments on commit 6da93ff

Please sign in to comment.