Skip to content

Commit

Permalink
Issue #451
Browse files Browse the repository at this point in the history
Aggiunto case test per verificare che l'invio di una notifica verso AppIO di una pendenza con debitore con identificativo non uppercase ma valido vada a buon fine.
  • Loading branch information
pintorig committed Feb 4, 2022
1 parent 02facfb commit 8dce231
Show file tree
Hide file tree
Showing 2 changed files with 232 additions and 2 deletions.
230 changes: 230 additions & 0 deletions integration-test/src/test/java/test/api/appio/avviso_pagamento.feature
Original file line number Diff line number Diff line change
Expand Up @@ -1468,3 +1468,233 @@ And match response ==
}
"""

Scenario: Caricamento pendenza dovuta con spedizione notifica AppIO, Debitore registrato su AppIO abilitato all'invio della notifica, CF debitore non uppercase

# Svuoto Cache Simulatore AppIO
Given url appio_api_url
And path 'resetCacheAppIO'
When method get
Then status 200

# Configurazione AppIO

* set configurazione_patch[0].path = path_batch_appio
* set configurazione_patch[0].value = configurazione_batchAppIO

Given url backofficeBaseurl
And path 'configurazioni'
And headers basicAutenticationHeader
And request configurazione_patch
When method patch
Then status 200

Given url backofficeBaseurl
And path 'configurazioni'
And headers basicAutenticationHeader
When method get
Then status 200
And match response.appIOBatch == configurazione_batchAppIO

* set configurazione_patch[0].path = path_avvisatura_appio
* set configurazione_patch[0].value = configurazione_avvisaturaAppIO

Given url backofficeBaseurl
And path 'configurazioni'
And headers basicAutenticationHeader
And request configurazione_patch
When method patch
Then status 200

Given url backofficeBaseurl
And path 'configurazioni'
And headers basicAutenticationHeader
When method get
Then status 200
And match response.avvisaturaAppIO == configurazione_avvisaturaAppIO

# abilitazione invio notifica appIO nel tipoPendenzaDominio

Given url backofficeBasicBaseurl
And path 'tipiPendenza', tipoPendenzaRinnovo
And headers gpAdminBasicAutenticationHeader
And request { descrizione: 'Rinnovo autorizzazione' , codificaIUV: null, pagaTerzi: true, abilitato : true}
When method put
Then assert responseStatus == 200 || responseStatus == 201

* set tipoPendenzaDominio_appIO.avvisaturaAppIO.apiKey = tipoPendenzaDominio_appIO_apiKey

Given url backofficeBasicBaseurl
And path 'domini', idDominio, 'tipiPendenza', tipoPendenzaRinnovo
And headers gpAdminBasicAutenticationHeader
And request tipoPendenzaDominio_appIO
When method put
Then assert responseStatus == 200 || responseStatus == 201

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

* def pendenzaPut = read('msg/pendenza-put_monovoce_riferimento.json')
* set pendenzaPut.idTipoPendenza = tipoPendenzaRinnovo
* set pendenzaPut.soggettoPagatore = debitoreCensitoAbilitatoAppIO
* set pendenzaPut.soggettoPagatore.identificativo = "rssMRA30A01H501I"

# Caricamento Pendenza e Controllo caricamento

Given url pendenzeBaseurl
And path '/pendenze', idA2A, idPendenza
And headers idA2ABasicAutenticationHeader
And request pendenzaPut
When method put
Then status 201
And match response == { idDominio: '#(idDominio)', numeroAvviso: '#regex[0-9]{18}' , UUID: '#notnull'}

* def responsePut = response

Given url pendenzeBaseurl
And path '/pendenze', idA2A, idPendenza
And headers idA2ABasicAutenticationHeader
When method get
Then status 200
And match response == read('classpath:test/api/pendenza/v2/pendenze/get/msg/pendenza-get-dettaglio.json')

* match response.numeroAvviso == responsePut.numeroAvviso
* match response.stato == 'NON_ESEGUITA'
* match response.voci == '#[1]'
* match response.voci[0].indice == 1
* match response.voci[0].stato == 'Non eseguito'

# aspetto spedizione notifica

* call sleep(1000)

* call read('classpath:utils/govpay-op-gestione-promemoria.feature')

* call sleep(20000)

* call read('classpath:utils/govpay-op-spedizione-notifiche-appIO.feature')

# Controllo Eventi salvati nel Giornale

* call sleep(20000)

* def codiceFiscaleDebitore = pendenzaPut.soggettoPagatore.identificativo
* call read('classpath:utils/appio-verifica-getprofile.feature')

* call sleep(3000)

Given url backofficeBaseurl
And path '/eventi'
And param idA2A = idA2A
And param idPendenza = idPendenza
And param tipoEvento = 'getProfile'
And param messaggi = true
And headers gpAdminBasicAutenticationHeader
When method get
Then status 200
And match response ==
"""
{
numRisultati: '#number',
numPagine: '#number',
risultatiPerPagina: 25,
pagina: 1,
prossimiRisultati: '#ignore',
risultati: '#array'
}
"""
And match response.risultati[0] ==
"""
{
"id": "#notnull",
"idDominio":"#(idDominio)",
"iuv":"#ignore",
"ccp":"#ignore",
"idA2A": "#(idA2A)",
"idPendenza": "#(''+idPendenza)",
"componente": "API_BACKEND_IO",
"categoriaEvento": "INTERFACCIA",
"ruolo": "CLIENT",
"tipoEvento": "getProfile",
"sottotipoEvento": "##null",
"esito": "OK",
"sottotipoEsito": "200",
"dettaglioEsito": "##null",
"dataEvento": "#notnull",
"durataEvento": "#notnull",
"datiPagoPA" : "##null",
"parametriRichiesta": {
"dataOraRichiesta":"#regex \\d\\d\\d\\d-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d\\.\\d\\d\\d",
"url": "#notnull",
"method": "GET",
"headers": "#array",
"payload": "##null"
},
"parametriRisposta": {
"dataOraRisposta":"#regex \\d\\d\\d\\d-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d\\.\\d\\d\\d",
"status": 200,
"headers": "#array",
"payload": "#notnull"
}
}
"""
And match response.risultati[0].parametriRichiesta.url == appio_api_url + '/profiles/' + codiceFiscaleDebitore


Given url backofficeBaseurl
And path '/eventi'
And param idA2A = idA2A
And param idPendenza = idPendenza
And param tipoEvento = 'submitMessageforUserWithFiscalCodeInBody'
And param messaggi = true
And headers gpAdminBasicAutenticationHeader
When method get
Then status 200
And match response ==
"""
{
numRisultati: '#number',
numPagine: '#number',
risultatiPerPagina: 25,
pagina: 1,
prossimiRisultati: '#ignore',
risultati: '#array'
}
"""
And match response.risultati[0] ==
"""
{
"id": "#notnull",
"idDominio":"#(idDominio)",
"iuv":"#ignore",
"ccp":"#ignore",
"idA2A": "#(idA2A)",
"idPendenza": "#(''+idPendenza)",
"componente": "API_BACKEND_IO",
"categoriaEvento": "INTERFACCIA",
"ruolo": "CLIENT",
"tipoEvento": "submitMessageforUserWithFiscalCodeInBody",
"sottotipoEvento": "##null",
"esito": "OK",
"sottotipoEsito": "201",
"dettaglioEsito": "##null",
"dataEvento": "#notnull",
"durataEvento": "#notnull",
"datiPagoPA" : "##null",
"parametriRichiesta": {
"dataOraRichiesta":"#regex \\d\\d\\d\\d-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d\\.\\d\\d\\d",
"url": "#notnull",
"method": "POST",
"headers": "#array",
"payload": "#notnull"
},
"parametriRisposta": {
"dataOraRisposta":"#regex \\d\\d\\d\\d-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d\\.\\d\\d\\d",
"status": 201,
"headers": "#array",
"payload": "#notnull"
}
}
"""
And match response.risultati[0].parametriRichiesta.url == appio_api_url + '/messages'



Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void run() {
notificheBD = new NotificheAppIoBD(configWrapper);

String url = this.appIo.getUrl(); // Base url del servizio
String fiscalCode = this.notifica.getDebitoreIdentificativo();
String fiscalCode = this.notifica.getDebitoreIdentificativo().toUpperCase();
try {
String operationId = appContext.setupAppIOClient(SWAGGER_OPERATION_GET_PROFILE, url);

Expand All @@ -120,7 +120,7 @@ public void run() {
ValidatorFactory vf = ValidatorFactory.newInstance();
ValidatoreUtils.validaCF(vf, "fiscal_code", fiscalCode);

LimitedProfile profile = clientGetProfile.getProfile(fiscalCode.toUpperCase(), this.tipoVersamentoDominio.getAppIOAPIKey(), SWAGGER_OPERATION_GET_PROFILE);
LimitedProfile profile = clientGetProfile.getProfile(fiscalCode, this.tipoVersamentoDominio.getAppIOAPIKey(), SWAGGER_OPERATION_GET_PROFILE);

if(profile.isSenderAllowed()) { // spedizione abilitata procedo
postMessage = true;
Expand Down

0 comments on commit 8dce231

Please sign in to comment.