Skip to content

Commit

Permalink
3.1.x (#79)
Browse files Browse the repository at this point in the history
Realizzata nuova gestione per il popolamento del giornale degli eventi
- il salvataggio degli eventi in modalità server e client e' pilotato dalla configurazione del sistema;
- ogni richiesta alle API (ente, govpay o pagoPA) e' considerata un evento e quindi e' potenzialmente da registrare;
- sono presenti anche gli eventi interni e quelli utente per memorizzare situazioni particolari.
  • Loading branch information
pintorig authored and nardil committed Jun 12, 2019
1 parent 6f197da commit 130dbf4
Show file tree
Hide file tree
Showing 206 changed files with 14,550 additions and 5,257 deletions.
12 changes: 9 additions & 3 deletions ear/src/main/application/META-INF/jboss-deployment-structure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<deployment>
<exclude-subsystems>
<subsystem name="jaxrs" />
<subsystem name="webservices" />
</exclude-subsystems>
<exclusions>
<module name="org.apache.cxf" />
Expand All @@ -26,13 +27,18 @@
<module name="org.apache.commons.logging" />
<module name="org.log4j" />
<module name="org.jboss.logging" />
</exclusions>
<dependencies>
<module name="org.apache.cxf" />
<module name="org.springframework.spring" />
<module name="org.codehaus.jackson.jackson-xc" />
<module name="org.codehaus.jackson.jackson-core-asl" />
<module name="org.codehaus.jackson.jackson-mapper-asl" />
</dependencies>
</exclusions>
<!-- <dependencies> -->
<!-- <module name="org.apache.cxf" /> -->
<!-- <module name="org.codehaus.jackson.jackson-xc" /> -->
<!-- <module name="org.codehaus.jackson.jackson-core-asl" /> -->
<!-- <module name="org.codehaus.jackson.jackson-mapper-asl" /> -->
<!-- </dependencies> -->
</sub-deployment>
<sub-deployment name="web-connector-${project.version}.war">
<exclusions>
Expand Down
5 changes: 4 additions & 1 deletion ear/src/main/application/properties/govpay.properties
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,17 @@ it.govpay.batch.avvisiPagamento.stampaAvvisiPagamento=${it.govpay.batch.avvisiPa
it.govpay.batch.caricamentoTracciati.enabled=${it.govpay.batch.caricamentoTracciati.enabled}


# GovPay API: Gestione Diagnostici e Dump
# GovPay API: Gestione Diagnostici, Dump e Giornale Eventi

# Gestione salvataggio diagnostici su file
it.govpay.context.savataggioDiagnosticiSuFile.enabled=${it.govpay.context.savataggioDiagnosticiSuFile.enabled}

# Gestione salvataggio dump su file
it.govpay.context.savataggioDumpSuFile.enabled=${it.govpay.context.savataggioDumpSuFile.enabled}

# Gestione creazione giornale eventi
it.govpay.context.giornaleEventi.enabled=${it.govpay.context.giornaleEventi.enabled}


# Govpay API BackOffice

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ Background:
* def codEntrataBollo = 'BOLLOT'
* def codLibero = 'LIBERO'
* def codSpontaneo = 'SPONTANEO'
* def codDovuto = 'DOVUTO'
* def codDovuto = 'DOVUTO'
* def idOperatoreSpid = 'RSSMRA30A01H501I'

* def basicAutenticationHeader = getBasicAuthenticationHeader( { username: govpay_backoffice_user, password: govpay_backoffice_password } )
* def gpAdminBasicAutenticationHeader = getBasicAuthenticationHeader( { username: govpay_backoffice_user, password: govpay_backoffice_password } )
Expand All @@ -29,6 +30,17 @@ Background:

Scenario: configurazione anagrafica base

#### creazione operatore spid
* def operatoreSpid = read('classpath:configurazione/v1/msg/operatore.json')

Given url backofficeBaseurl
And path 'operatori', idOperatoreSpid
And headers basicAutenticationHeader
And request operatoreSpid
When method put
Then assert responseStatus == 200 || responseStatus == 201


#### creazione intermediario
* def intermediario = read('classpath:configurazione/v1/msg/intermediario.json')

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ragioneSociale": "Mario Rossi",
"domini": ["*"],
"tipiPendenza": ["*"],
"acl": [ { "servizio": "Pagamenti", "autorizzazioni": [ "R", "W" ] }, { "servizio": "Pendenze", "autorizzazioni": [ "R", "W" ] } ],
"abilitato": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
Feature: Registrazione evento al caricamento di una pendenza da api-backoffice

Background:

* callonce read('classpath:utils/common-utils.feature')
* callonce read('classpath:configurazione/v1/anagrafica.feature')
* def idPendenza = getCurrentTimeMillis()
* def pendenzaPut = read('classpath:test/api/pendenza/pendenze/v1/put/msg/pendenza-put_monovoce_riferimento.json')

Scenario: Evento creazione da operatore basic in api Backoffice

* def pendenzaGet = read('classpath:test/api/pendenza/pendenze/v1/get/msg/pendenza-get-dettaglio.json')
* def pendenzeBaseurl = getGovPayApiBaseUrl({api: 'backoffice', versione: 'v1', autenticazione: 'basic'})

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

* def pendenzaPutResponse = response

* call sleep(200)
* def backofficeBaseurl = getGovPayApiBaseUrl({api: 'backoffice', versione: 'v1', autenticazione: 'basic'})

Given url backofficeBaseurl
And path '/eventi'
And param idA2A = idA2A
And param idPendenza = idPendenza
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":"##null",
"iuv":"##null",
"ccp":"##null",
"idA2A": "#(idA2A)",
"idPendenza": "#(''+idPendenza)",
"idPagamento": "##null",
"componente": "API_BACKOFFICE",
"categoriaEvento": "INTERFACCIA",
"ruolo": "SERVER",
"tipoEvento": "addPendenza",
"sottotipoEvento": "##null",
"esito": "OK",
"dataEvento": "#notnull",
"durataEvento": "#notnull",
"sottotipoEsito": "201",
"dettaglioEsito": "##null",
"datiPagoPA" : "##null",
"parametriRichiesta": {
"principal": "gpadmin",
"utente": "Amministratore",
"dataOraRichiesta":"#regex \\d\\d\\d\\d-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d\\.\\d\\d\\d\\+\\d\\d\\d\\d",
"url": "#('/govpay/backend/api/backoffice/rs/basic/v1/pendenze/' + idA2A + '/' + idPendenza)",
"method": "PUT",
"headers": "#array",
"payload": "#notnull"
},
"parametriRisposta": {
"dataOraRisposta":"#regex \\d\\d\\d\\d-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d\\.\\d\\d\\d\\+\\d\\d\\d\\d",
"status": 201,
"headers": "#array",
"payload": "#notnull"
}
}
"""
* json payloadRichiesta = decodeBase64(response.risultati[0].parametriRichiesta.payload)
* match payloadRichiesta == pendenzaPut
* json payloadRisposta = decodeBase64(response.risultati[0].parametriRisposta.payload)
* match payloadRisposta == pendenzaPutResponse

Scenario: Evento creazione da operatore spid in api Backoffice

* def pendenzaGet = read('classpath:test/api/pendenza/pendenze/v1/get/msg/pendenza-get-dettaglio.json')
* def pendenzeBaseurl = getGovPayApiBaseUrl({api: 'backoffice', versione: 'v1', autenticazione: 'spid'})
* def spidHeaders = {'X-SPID-FISCALNUMBER': 'RSSMRA30A01H501I','X-SPID-NAME': 'Mario','X-SPID-FAMILYNAME': 'Rossi','X-SPID-EMAIL': 'mrossi@mailserver.host.it'}

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

* def pendenzaPutResponse = response

* call sleep(200)
* def backofficeBaseurl = getGovPayApiBaseUrl({api: 'backoffice', versione: 'v1', autenticazione: 'basic'})

Given url backofficeBaseurl
And path '/eventi'
And param idA2A = idA2A
And param idPendenza = idPendenza
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":"##null",
"iuv":"##null",
"ccp":"##null",
"idA2A": "#(idA2A)",
"idPendenza": "#(''+idPendenza)",
"idPagamento": "##null",
"componente": "API_BACKOFFICE",
"categoriaEvento": "INTERFACCIA",
"ruolo": "SERVER",
"tipoEvento": "addPendenza",
"sottotipoEvento": "##null",
"esito": "OK",
"sottotipoEsito": "201",
"dettaglioEsito": "##null",
"dataEvento": "#notnull",
"durataEvento": "#notnull",
"datiPagoPA" : "##null",
"parametriRichiesta": {
"principal": "RSSMRA30A01H501I",
"utente": "Mario Rossi",
"dataOraRichiesta":"#regex \\d\\d\\d\\d-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d\\.\\d\\d\\d\\+\\d\\d\\d\\d",
"url": "#('/govpay/backend/api/backoffice/rs/spid/v1/pendenze/' + idA2A + '/' + idPendenza)",
"method": "PUT",
"headers": "#array",
"payload": "#notnull"
},
"parametriRisposta": {
"dataOraRisposta":"#regex \\d\\d\\d\\d-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d\\.\\d\\d\\d\\+\\d\\d\\d\\d",
"status": 201,
"headers": "#array",
"payload": "#notnull"
}
}
"""
* json payloadRichiesta = decodeBase64(response.risultati[0].parametriRichiesta.payload)
* match payloadRichiesta == pendenzaPut
* json payloadRisposta = decodeBase64(response.risultati[0].parametriRisposta.payload)
* match payloadRisposta == pendenzaPutResponse

Scenario: Evento creazione da applicazione in api Backoffice

* def pendenzaGet = read('classpath:test/api/pendenza/pendenze/v1/get/msg/pendenza-get-dettaglio.json')
* def pendenzeBaseurl = getGovPayApiBaseUrl({api: 'backoffice', versione: 'v1', autenticazione: 'basic'})

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

* def pendenzaPutResponse = response

* call sleep(200)
* def backofficeBaseurl = getGovPayApiBaseUrl({api: 'backoffice', versione: 'v1', autenticazione: 'basic'})

Given url backofficeBaseurl
And path '/eventi'
And param idA2A = idA2A
And param idPendenza = idPendenza
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":"##null",
"iuv":"##null",
"ccp":"##null",
"idA2A": "#(idA2A)",
"idPendenza": "#(''+idPendenza)",
"idPagamento": "##null",
"componente": "API_BACKOFFICE",
"categoriaEvento": "INTERFACCIA",
"ruolo": "SERVER",
"tipoEvento": "addPendenza",
"sottotipoEvento": "##null",
"esito": "OK",
"sottotipoEsito": "201",
"dettaglioEsito": "##null",
"dataEvento": "#notnull",
"durataEvento": "#notnull",
"datiPagoPA" : "##null",
"parametriRichiesta": {
"principal": "#(idA2A)",
"utente": "#(idA2A)",
"dataOraRichiesta":"#regex \\d\\d\\d\\d-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d\\.\\d\\d\\d\\+\\d\\d\\d\\d",
"url": "#('/govpay/backend/api/backoffice/rs/basic/v1/pendenze/' + idA2A + '/' + idPendenza)",
"method": "PUT",
"headers": "#array",
"payload": "#notnull"
},
"parametriRisposta": {
"dataOraRisposta":"#regex \\d\\d\\d\\d-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d\\.\\d\\d\\d\\+\\d\\d\\d\\d",
"status": 201,
"headers": "#array",
"payload": "#notnull"
}
}
"""
* json payloadRichiesta = decodeBase64(response.risultati[0].parametriRichiesta.payload)
* match payloadRichiesta == pendenzaPut
* json payloadRisposta = decodeBase64(response.risultati[0].parametriRisposta.payload)
* match payloadRisposta == pendenzaPutResponse

0 comments on commit 130dbf4

Please sign in to comment.