@@ -44,19 +44,20 @@ local envelope = [[
44
44
"encryptionKeyId": "%s",
45
45
"pioneerId": "11111111-1111-1111-1111-111111111111",
46
46
"studyName": "%s",
47
- "studyVersion": %d
47
+ "schemaName": "%s",
48
+ "schemaVersion": %d
48
49
}
49
50
}
50
51
}]]
51
52
52
53
53
54
local submissions = {
54
- {' { "exampleString " : "foobar "}' , ' pioneer-20170901' , " example " , 1 }, -- valid
55
- {' text' , ' pioneer-20170901' , " example " , 1 }, -- parse failure
56
- {' { "exampleString " : 1}' , ' pioneer-20170901' , " example " , 1 }, -- study schema validation error
57
- {' { "exampleString " : "foobar"}' , ' pioneer-20200901' , " example " , 1 }, -- no encryption key
58
- {' { "exampleString " : "foobar"}' , ' pioneer-20170901' , " bogus" , 1 }, -- no schema
59
- {' { "exampleString " : "foobar"}' , ' pioneer-20170901' , " example " , 2 }, -- no version
55
+ {' { "eventId " : "enrolled "}' , ' pioneer-20170901' , " test-study " , " event " , 1 }, -- valid
56
+ {' text' , ' pioneer-20170901' , " test-study " , " event " , 1 }, -- parse failure
57
+ {' { "eventId " : 1}' , ' pioneer-20170901' , " test-study " , " event " , 1 }, -- study schema validation error
58
+ {' { "eventId " : "foobar"}' , ' pioneer-20200901' , " test-study " , " event " , 1 }, -- no encryption key
59
+ {' { "eventId " : "foobar"}' , ' pioneer-20170901' , " test-study " , " bogus" , 1 }, -- no schema
60
+ {' { "eventId " : "foobar"}' , ' pioneer-20170901' , " test-study " , " event " , 2 }, -- no version
60
61
}
61
62
62
63
local msg = {
@@ -81,7 +82,7 @@ function process_message()
81
82
for i ,v in ipairs (submissions ) do
82
83
msg .Fields .uri = string.format (uri_template , i )
83
84
local jwe = jose .jwe_encrypt (jwk , v [1 ], hdr )
84
- msg .Fields .content = string.format (envelope , jwe :export (), v [2 ], v [3 ], v [4 ])
85
+ msg .Fields .content = string.format (envelope , jwe :export (), v [2 ], v [3 ], v [4 ], v [ 5 ] )
85
86
inject_message (msg )
86
87
if i == 1 then inject_message (msg ) end -- test duplicate
87
88
cnt = cnt + 1
@@ -103,14 +104,14 @@ function process_message()
103
104
-- invalid import
104
105
cnt = cnt + 1
105
106
msg .Fields .uri = string.format (uri_template , cnt )
106
- msg .Fields .content = string.format (envelope , " xxxxxxxxxxxxxxxx" , v [2 ], v [3 ], v [4 ])
107
+ msg .Fields .content = string.format (envelope , " xxxxxxxxxxxxxxxx" , v [2 ], v [3 ], v [4 ], v [ 5 ] )
107
108
inject_message (msg )
108
109
109
110
-- invalid encryption
110
111
cnt = cnt + 1
111
112
msg .Fields .uri = string.format (uri_template , cnt )
112
113
local jwe = jose .jwe_encrypt (jwk , submissions [1 ][1 ], hdr )
113
- msg .Fields .content = string.format (envelope , string.gsub (jwe :export (), " .$" , " X" ), v [2 ], v [3 ], v [4 ])
114
+ msg .Fields .content = string.format (envelope , string.gsub (jwe :export (), " .$" , " X" ), v [2 ], v [3 ], v [4 ], v [ 5 ] )
114
115
inject_message (msg )
115
116
116
117
return 0
0 commit comments