/
check-traccia.feature
58 lines (43 loc) · 2.01 KB
/
check-traccia.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Feature: Controllo traccia IDAR01
Scenario: Controllo traccia IDAR01
* def profilo_sicurezza = karate.get('profilo_sicurezza', 'IDAR01')
* def profilo_interazione = karate.get('profilo_interazione', 'bloccante')
* def other_checks = karate.get('other_checks', [])
* def get_traccia = read('classpath:utils/get_traccia.js')
* def traccia_to_match =
"""
([
{ name: 'ProfiloInterazione', value: profilo_interazione },
{ name: 'ProfiloSicurezzaCanale', value: 'IDAC01' },
{ name: 'ProfiloSicurezzaMessaggio', value: profilo_sicurezza },
{ name: 'ProfiloSicurezzaMessaggio-IssuedAt', value: '#string' },
{ name: 'ProfiloSicurezzaMessaggio-NotBefore', value: '#string' },
{ name: 'ProfiloSicurezzaMessaggio-Expiration', value: '#string' },
{ name: 'ProfiloSicurezzaMessaggio-MessageId', value: '#uuid' },
{ name: 'ProfiloSicurezzaMessaggio-Audience', value: token.payload.aud },
{ name: 'ProfiloSicurezzaMessaggio-ClientId', value: token.payload.client_id },
{ name: 'ProfiloSicurezzaMessaggio-Issuer', value: token.payload.iss },
{ name: 'ProfiloSicurezzaMessaggio-Subject', value: token.payload.sub },
{ name: 'ProfiloSicurezzaMessaggio-X509-Subject', value: x509sub },
{ name: 'ProfiloSicurezzaMessaggio-X509-Issuer', value: 'CN=ExampleCA, O=Example, L=Pisa, ST=Italy, C=IT' }
])
"""
* def traccia_to_match = karate.append(traccia_to_match, other_checks)
* def result = get_traccia(tid,tipo)
* match result contains deep traccia_to_match
* def id_messaggio_traccia =
"""
id_messaggio_traccia = token.payload.jti
"""
* def requestMessageIdValue =
"""
if (tipo=='Risposta') {
requestMessageIdValue = requestMessageId
}
else {
requestMessageIdValue = 'undefined'
}
"""
* def check_tracciamento_diagnostica = read('classpath:utils/check-tracciamento-diagnostica.feature')
# Verifico che le tracce e i diagnostici utilizzino i corretti id messaggio
* call check_tracciamento_diagnostica ({ tid: tid, traceMessageId:id_messaggio_traccia, tipo:tipo, requestMessageId:requestMessageIdValue })