Skip to content

Commit

Permalink
PAGOPA-2004 adapting junit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoRuzzier committed Jul 31, 2024
1 parent 81c816d commit 5873c88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ void nodoChiediElencoFlussiTestSettersTest() throws Exception {
String idPa = "12345";
String idBroker = "123456";
String idStazione = "123456_00";
nodoChiediElencoFlussi.nodoChiediElencoFlussiRendicontazione(idPa, idBroker, idStazione);
String stazionePassword = "***";
nodoChiediElencoFlussi.nodoChiediElencoFlussiRendicontazione(idPa, idBroker, idStazione, stazionePassword);

assertTrue(Boolean.TRUE);
}
Expand Down
9 changes: 5 additions & 4 deletions src/test/java/it/gov/pagopa/reporting/RetrieveFlowsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ void runOkTest() throws Exception {
doReturn(flowsService).when(function).getFlowsServiceInstance(logger);
doReturn(cacheClient).when(function).getCacheClientInstance();

doNothing().when(nodeClient).nodoChiediElencoFlussiRendicontazione(anyString(), anyString(), anyString());
doNothing().when(nodeClient).nodoChiediElencoFlussiRendicontazione(anyString(), anyString(), anyString(), anyString());
when(nodeClient.getNodoChiediElencoFlussiRendicontazioneFault()).thenReturn(null);
when(nodeClient.getNodoChiediElencoFlussiRendicontazione()).thenReturn(elencoFlussi);// test
String message = "{\"idPA\":[\"9000000001\",\"9000000002\",\"9000000003\"]}";
function.run(message, context);

// Asserts
verify(context, times(1)).getLogger();
verify(nodeClient, times(3)).nodoChiediElencoFlussiRendicontazione(anyString(), anyString(), anyString());
verify(nodeClient, times(3)).nodoChiediElencoFlussiRendicontazione(anyString(), anyString(), anyString(), anyString());
}

@Test
Expand All @@ -96,6 +96,7 @@ void runKoTest() throws Exception {
.stationCode("12345_00")
.brokerCode("12345")
.enabled(true)
.password("***")
.build());
List<CreditorInstitutionStation> creditorInstitutionStations = List.of(
CreditorInstitutionStation.builder()
Expand Down Expand Up @@ -129,7 +130,7 @@ void runKoTest() throws Exception {

// doNothing().when(nodeClient).setSslContext();

doNothing().when(nodeClient).nodoChiediElencoFlussiRendicontazione(anyString(), anyString(), anyString());
doNothing().when(nodeClient).nodoChiediElencoFlussiRendicontazione(anyString(), anyString(), anyString(), anyString());
when(nodeClient.getNodoChiediElencoFlussiRendicontazioneFault()).thenReturn(objectFactory.createFaultBean());
when(nodeClient.getNodoChiediElencoFlussiRendicontazione()).thenReturn(null);
when(cacheClient.getCache()).thenReturn(cacheResponse);
Expand All @@ -139,7 +140,7 @@ void runKoTest() throws Exception {

// Asserts
verify(context, times(1)).getLogger();
verify(nodeClient, times(3)).nodoChiediElencoFlussiRendicontazione(anyString(), anyString(), anyString());
verify(nodeClient, times(3)).nodoChiediElencoFlussiRendicontazione(anyString(), anyString(), anyString(), anyString());
}

@Test
Expand Down

0 comments on commit 5873c88

Please sign in to comment.