Skip to content

Commit

Permalink
Issue #467
Browse files Browse the repository at this point in the history
Aggiunti attributi mancanti iuvAvviso e iuvPagamento.
Corretto formato del campo datiAllegati.
  • Loading branch information
pintorig committed Mar 4, 2022
1 parent e07f417 commit 978b0ef
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,71 @@ When method get
Then status 200
And match response.rpp[0].rpt.soggettoVersante == null


@test1
Scenario: Pagamento avviso precaricato autenticato multivoce

* def idPendenza = getCurrentTimeMillis()
* def pendenzeBaseurl = getGovPayApiBaseUrl({api: 'pendenze', versione: 'v2', autenticazione: 'basic'})
* def basicAutenticationHeader = getBasicAuthenticationHeader( { username: idA2A, password: pwdA2A } )
* def pendenza = read('classpath:test/api/pendenza/v2/pendenze/put/msg/pendenza-put_multivoce.json')

Given url pendenzeBaseurl
And path 'pendenze', idA2A, idPendenza
And headers basicAutenticationHeader
And request pendenza
When method put
Then status 201

* def numeroAvviso = response.numeroAvviso
* def pagamentiBaseurl = getGovPayApiBaseUrl({api: 'pagamento', versione: 'v2', autenticazione: 'basic'})
* def pagamentoPost = read('classpath:test/api/pagamento/v2/pagamenti/post/msg/pagamento-post_riferimento_avviso.json')

Given url pagamentiBaseurl
And path '/pagamenti'
And headers basicAutenticationHeader
And request pagamentoPost
When method post
Then status 201
And match response == { id: '#notnull', location: '#notnull', redirect: '#notnull', idSession: '#notnull' }

Given url pagamentiBaseurl
And path '/pagamenti/byIdSession/', response.idSession
And headers basicAutenticationHeader
When method get
Then status 200


@test2
Scenario: Pagamento avviso precaricato autenticato multivoce multibeneficiario

* def idPendenza = getCurrentTimeMillis()
* def pendenzeBaseurl = getGovPayApiBaseUrl({api: 'pendenze', versione: 'v2', autenticazione: 'basic'})
* def basicAutenticationHeader = getBasicAuthenticationHeader( { username: idA2A, password: pwdA2A } )
* def pendenza = read('classpath:test/api/pendenza/v2/pendenze/put/msg/pendenza-put_multivoce.json')
* def idDominio_2 = '12345678902'
* set pendenza.voci[1].idDominio = idDominio_2

Given url pendenzeBaseurl
And path 'pendenze', idA2A, idPendenza
And headers basicAutenticationHeader
And request pendenza
When method put
Then status 201

* def numeroAvviso = response.numeroAvviso
* def pagamentiBaseurl = getGovPayApiBaseUrl({api: 'pagamento', versione: 'v2', autenticazione: 'basic'})
* def pagamentoPost = read('classpath:test/api/pagamento/v2/pagamenti/post/msg/pagamento-post_riferimento_avviso.json')

Given url pagamentiBaseurl
And path '/pagamenti'
And headers basicAutenticationHeader
And request pagamentoPost
When method post
Then status 422
And match response == { categoria: 'RICHIESTA', codice: '#notnull', descrizione: 'Richiesta non valida', dettaglio: '#notnull' , id: '#notnull', location: '#notnull' }
And match response.codice == 'VER_038'
And match response.dettaglio == '#("La pendenza (IdA2A:"+ idA2A +" Id:"+ idPendenza +") e\' di tipo multibeneficiario non consentito per pagamenti spontanei.")'



Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@
"rpp":"#[]",
"pagamenti":"#[]",
"tipo":"#string",
"UUID":"#string"
"UUID":"#string",
"iuvAvviso":"##string",
"iuvPagamento":"##string"
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,59 @@ Examples:



Scenario Outline: Lettura dettaglio pendenza con dati allegati

* def idPendenza = getCurrentTimeMillis()
* def pendenzaPut = read('classpath:test/api/pendenza/v2/pendenze/put/msg/pendenza-put_multivoce_bollo.json')
* def pendenzeBaseurl = getGovPayApiBaseUrl({api: 'pendenze', versione: 'v2', autenticazione: 'basic'})

* set pendenzaPut.datiAllegati = <datiAllegati>

* def applicazione = read('msg/applicazione_auth.json')

Given url backofficeBaseurl
And path 'applicazioni', idA2A
And headers gpAdminBasicAutenticationHeader
And request applicazione
When method put
Then assert responseStatus == 200 || responseStatus == 201

* call read('classpath:configurazione/v1/operazioni-resetCache.feature')

* def dataPutStart = getDateTime()

Given url pendenzeBaseurl
And path '/pendenze', idA2A, idPendenza
And headers idA2ABasicAutenticationHeader
And request pendenzaPut
When method put
Then status 201

* def dataPutEnd = getDateTime()

Given url pendenzeBaseurl
And path '/pendenze'
And param idA2A = idA2A
And param dataDa = dataPutStart
And param dataA = dataPutEnd
And headers idA2ABasicAutenticationHeader
When method get
Then status 200
And match response.risultati[0].datiAllegati == <datiAllegati>

Given url pendenzeBaseurl
And path '/pendenze', idA2A, idPendenza
And headers idA2ABasicAutenticationHeader
When method get
Then status 200
And match response.datiAllegati == <datiAllegati>

Examples:
| datiAllegati |
| "datoAllegato" |
| 10 |
| [ "datoAllegato1" , "datoAllegato2" ] |
| [ 10 , 20 ] |
| [ datoAllegato1: 10 , datoAllegato2: 20 ] |


Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public static Pendenza toRsModel(it.govpay.bd.model.Versamento versamento,List<P
rsModel.setIdA2A(versamento.getApplicazione(configWrapper).getCodApplicazione());
rsModel.setIdPendenza(versamento.getCodVersamentoEnte());
rsModel.setImporto(versamento.getImportoTotale());
rsModel.setIuvPagamento(versamento.getIuvPagamento());
rsModel.setIuvAvviso(versamento.getIuvVersamento());
// rsModel.setNome(versamento.getNome());
rsModel.setNumeroAvviso(versamento.getNumeroAvviso());
rsModel.setSoggettoPagatore(controlloUtenzaPagatore(AnagraficaConverter.toSoggettoRsModel(versamento.getAnagraficaDebitore()),user));
Expand Down Expand Up @@ -198,11 +200,13 @@ public static PendenzaIndex toRsModelIndex(it.govpay.bd.model.Versamento versame

rsModel.setIdPendenza(versamento.getCodVersamentoEnte());
rsModel.setImporto(versamento.getImportoTotale());
rsModel.setIuvPagamento(versamento.getIuvPagamento());
rsModel.setIuvAvviso(versamento.getIuvVersamento());
// rsModel.setNome(versamento.getNome());
rsModel.setNumeroAvviso(versamento.getNumeroAvviso());
rsModel.setSoggettoPagatore(controlloUtenzaPagatore(AnagraficaConverter.toSoggettoRsModel(versamento.getAnagraficaDebitore()),user));
if(versamento.getDatiAllegati() != null)
rsModel.setDatiAllegati(versamento.getDatiAllegati());
rsModel.setDatiAllegati(new RawObject(versamento.getDatiAllegati()));

StatoPendenza statoPendenza = null;

Expand Down

0 comments on commit 978b0ef

Please sign in to comment.