@@ -189,7 +189,7 @@ func TestDeletePublicKey(t *testing.T) {
189189 }{
190190 {
191191 description : "fails when role is observer" ,
192- fingerprint : "fingerprint " ,
192+ fingerprint : "8e:b3:e2:ce:3c:6c:27:ff:51:c9:5d:77:af:92:2f:d8 " ,
193193 headers : map [string ]string {
194194 "Content-Type" : "application/json" ,
195195 "X-Tenant-ID" : "00000000-0000-4000-0000-000000000000" ,
@@ -202,7 +202,7 @@ func TestDeletePublicKey(t *testing.T) {
202202 },
203203 {
204204 description : "fails when role is operator" ,
205- fingerprint : "fingerprint " ,
205+ fingerprint : "8e:b3:e2:ce:3c:6c:27:ff:51:c9:5d:77:af:92:2f:d8 " ,
206206 headers : map [string ]string {
207207 "Content-Type" : "application/json" ,
208208 "X-Tenant-ID" : "00000000-0000-4000-0000-000000000000" ,
@@ -214,8 +214,8 @@ func TestDeletePublicKey(t *testing.T) {
214214 expected : Expected {status : http .StatusForbidden },
215215 },
216216 {
217- description : "fails when try to deleting an existing public key" ,
218- fingerprint : "fingerprint " ,
217+ description : "fails when try to deleting a non existent public key" ,
218+ fingerprint : "8e:b3:e2:ce:3c:6c:27:ff:51:c9:5d:77:af:92:2f:d8 " ,
219219 headers : map [string ]string {
220220 "Content-Type" : "application/json" ,
221221 "X-Tenant-ID" : "00000000-0000-4000-0000-000000000000" ,
@@ -224,15 +224,32 @@ func TestDeletePublicKey(t *testing.T) {
224224 },
225225 requiredMocks : func () {
226226 svcMock .
227- On ("DeletePublicKey" , gomock .Anything , "fingerprint " , "00000000-0000-4000-0000-000000000000" ).
227+ On ("DeletePublicKey" , gomock .Anything , "8e:b3:e2:ce:3c:6c:27:ff:51:c9:5d:77:af:92:2f:d8 " , "00000000-0000-4000-0000-000000000000" ).
228228 Return (svc .ErrNotFound ).
229229 Once ()
230230 },
231231 expected : Expected {status : http .StatusNotFound },
232232 },
233+ {
234+ description : "success when fingerprint is encoded" ,
235+ fingerprint : "8e%3Ab3%3Ae2%3Ace%3A3c%3A6c%3A27%3Aff%3A51%3Ac9%3A5d%3A77%3Aaf%3A92%3A2f%3Ad8" ,
236+ headers : map [string ]string {
237+ "Content-Type" : "application/json" ,
238+ "X-Tenant-ID" : "00000000-0000-4000-0000-000000000000" ,
239+ "X-Role" : "owner" ,
240+ "X-ID" : "000000000000000000000000" ,
241+ },
242+ requiredMocks : func () {
243+ svcMock .
244+ On ("DeletePublicKey" , gomock .Anything , "8e:b3:e2:ce:3c:6c:27:ff:51:c9:5d:77:af:92:2f:d8" , "00000000-0000-4000-0000-000000000000" ).
245+ Return (nil ).
246+ Once ()
247+ },
248+ expected : Expected {status : http .StatusOK },
249+ },
233250 {
234251 description : "success when try to deleting an existing public key" ,
235- fingerprint : "fingerprint " ,
252+ fingerprint : "8e:b3:e2:ce:3c:6c:27:ff:51:c9:5d:77:af:92:2f:d8 " ,
236253 headers : map [string ]string {
237254 "Content-Type" : "application/json" ,
238255 "X-Tenant-ID" : "00000000-0000-4000-0000-000000000000" ,
@@ -241,7 +258,7 @@ func TestDeletePublicKey(t *testing.T) {
241258 },
242259 requiredMocks : func () {
243260 svcMock .
244- On ("DeletePublicKey" , gomock .Anything , "fingerprint " , "00000000-0000-4000-0000-000000000000" ).
261+ On ("DeletePublicKey" , gomock .Anything , "8e:b3:e2:ce:3c:6c:27:ff:51:c9:5d:77:af:92:2f:d8 " , "00000000-0000-4000-0000-000000000000" ).
245262 Return (nil ).
246263 Once ()
247264 },
0 commit comments