@@ -271,7 +271,7 @@ func TestDB_GetExternalAccountKeyByReference(t *testing.T) {
271
271
db : & certdb.MockNoSQLDB {
272
272
MGet : func (bucket , key []byte ) ([]byte , error ) {
273
273
switch string (bucket ) {
274
- case string (externalAccountKeysByReferenceTable ):
274
+ case string (externalAccountKeyIDsByReferenceTable ):
275
275
assert .Equals (t , string (key ), provID + "." + ref )
276
276
return dbrefBytes , nil
277
277
case string (externalAccountKeyTable ):
@@ -306,7 +306,7 @@ func TestDB_GetExternalAccountKeyByReference(t *testing.T) {
306
306
ref : ref ,
307
307
db : & certdb.MockNoSQLDB {
308
308
MGet : func (bucket , key []byte ) ([]byte , error ) {
309
- assert .Equals (t , string (bucket ), string (externalAccountKeysByReferenceTable ))
309
+ assert .Equals (t , string (bucket ), string (externalAccountKeyIDsByReferenceTable ))
310
310
assert .Equals (t , string (key ), provID + "." + ref )
311
311
return nil , nosqldb .ErrNotFound
312
312
},
@@ -319,7 +319,7 @@ func TestDB_GetExternalAccountKeyByReference(t *testing.T) {
319
319
ref : ref ,
320
320
db : & certdb.MockNoSQLDB {
321
321
MGet : func (bucket , key []byte ) ([]byte , error ) {
322
- assert .Equals (t , string (bucket ), string (externalAccountKeysByReferenceTable ))
322
+ assert .Equals (t , string (bucket ), string (externalAccountKeyIDsByReferenceTable ))
323
323
assert .Equals (t , string (key ), provID + "." + ref )
324
324
return nil , errors .New ("force" )
325
325
},
@@ -332,7 +332,7 @@ func TestDB_GetExternalAccountKeyByReference(t *testing.T) {
332
332
ref : ref ,
333
333
db : & certdb.MockNoSQLDB {
334
334
MGet : func (bucket , key []byte ) ([]byte , error ) {
335
- assert .Equals (t , string (bucket ), string (externalAccountKeysByReferenceTable ))
335
+ assert .Equals (t , string (bucket ), string (externalAccountKeyIDsByReferenceTable ))
336
336
assert .Equals (t , string (key ), provID + "." + ref )
337
337
return []byte {0 }, nil
338
338
},
@@ -352,7 +352,7 @@ func TestDB_GetExternalAccountKeyByReference(t *testing.T) {
352
352
db : & certdb.MockNoSQLDB {
353
353
MGet : func (bucket , key []byte ) ([]byte , error ) {
354
354
switch string (bucket ) {
355
- case string (externalAccountKeysByReferenceTable ):
355
+ case string (externalAccountKeyIDsByReferenceTable ):
356
356
assert .Equals (t , string (key ), provID + "." + ref )
357
357
return dbrefBytes , nil
358
358
case string (externalAccountKeyTable ):
@@ -642,7 +642,7 @@ func TestDB_DeleteExternalAccountKey(t *testing.T) {
642
642
db : & certdb.MockNoSQLDB {
643
643
MGet : func (bucket , key []byte ) ([]byte , error ) {
644
644
switch string (bucket ) {
645
- case string (externalAccountKeysByReferenceTable ):
645
+ case string (externalAccountKeyIDsByReferenceTable ):
646
646
assert .Equals (t , string (key ), provID + "." + ref )
647
647
return dbrefBytes , nil
648
648
case string (externalAccountKeyTable ):
@@ -660,7 +660,7 @@ func TestDB_DeleteExternalAccountKey(t *testing.T) {
660
660
},
661
661
MDel : func (bucket , key []byte ) error {
662
662
switch string (bucket ) {
663
- case string (externalAccountKeysByReferenceTable ):
663
+ case string (externalAccountKeyIDsByReferenceTable ):
664
664
assert .Equals (t , string (key ), provID + "." + ref )
665
665
return nil
666
666
case string (externalAccountKeyTable ):
@@ -674,7 +674,7 @@ func TestDB_DeleteExternalAccountKey(t *testing.T) {
674
674
MCmpAndSwap : func (bucket , key , old , new []byte ) ([]byte , bool , error ) {
675
675
fmt .Println (string (bucket ))
676
676
switch string (bucket ) {
677
- case string (externalAccountKeysByReferenceTable ):
677
+ case string (externalAccountKeyIDsByReferenceTable ):
678
678
assert .Equals (t , provID + "." + ref , string (key ))
679
679
return nil , true , nil
680
680
case string (externalAccountKeyIDsByProvisionerIDTable ):
@@ -745,7 +745,7 @@ func TestDB_DeleteExternalAccountKey(t *testing.T) {
745
745
db : & certdb.MockNoSQLDB {
746
746
MGet : func (bucket , key []byte ) ([]byte , error ) {
747
747
switch string (bucket ) {
748
- case string (externalAccountKeysByReferenceTable ):
748
+ case string (externalAccountKeyIDsByReferenceTable ):
749
749
assert .Equals (t , string (key ), ref )
750
750
return dbrefBytes , nil
751
751
case string (externalAccountKeyTable ):
@@ -758,7 +758,7 @@ func TestDB_DeleteExternalAccountKey(t *testing.T) {
758
758
},
759
759
MDel : func (bucket , key []byte ) error {
760
760
switch string (bucket ) {
761
- case string (externalAccountKeysByReferenceTable ):
761
+ case string (externalAccountKeyIDsByReferenceTable ):
762
762
assert .Equals (t , string (key ), provID + "." + ref )
763
763
return errors .New ("force" )
764
764
case string (externalAccountKeyTable ):
@@ -795,7 +795,7 @@ func TestDB_DeleteExternalAccountKey(t *testing.T) {
795
795
db : & certdb.MockNoSQLDB {
796
796
MGet : func (bucket , key []byte ) ([]byte , error ) {
797
797
switch string (bucket ) {
798
- case string (externalAccountKeysByReferenceTable ):
798
+ case string (externalAccountKeyIDsByReferenceTable ):
799
799
assert .Equals (t , string (key ), ref )
800
800
return dbrefBytes , nil
801
801
case string (externalAccountKeyTable ):
@@ -808,7 +808,7 @@ func TestDB_DeleteExternalAccountKey(t *testing.T) {
808
808
},
809
809
MDel : func (bucket , key []byte ) error {
810
810
switch string (bucket ) {
811
- case string (externalAccountKeysByReferenceTable ):
811
+ case string (externalAccountKeyIDsByReferenceTable ):
812
812
assert .Equals (t , string (key ), provID + "." + ref )
813
813
return nil
814
814
case string (externalAccountKeyTable ):
@@ -845,7 +845,7 @@ func TestDB_DeleteExternalAccountKey(t *testing.T) {
845
845
db : & certdb.MockNoSQLDB {
846
846
MGet : func (bucket , key []byte ) ([]byte , error ) {
847
847
switch string (bucket ) {
848
- case string (externalAccountKeysByReferenceTable ):
848
+ case string (externalAccountKeyIDsByReferenceTable ):
849
849
assert .Equals (t , string (key ), ref )
850
850
return dbrefBytes , nil
851
851
case string (externalAccountKeyTable ):
@@ -860,7 +860,7 @@ func TestDB_DeleteExternalAccountKey(t *testing.T) {
860
860
},
861
861
MDel : func (bucket , key []byte ) error {
862
862
switch string (bucket ) {
863
- case string (externalAccountKeysByReferenceTable ):
863
+ case string (externalAccountKeyIDsByReferenceTable ):
864
864
assert .Equals (t , string (key ), provID + "." + ref )
865
865
return nil
866
866
case string (externalAccountKeyTable ):
@@ -939,7 +939,7 @@ func TestDB_CreateExternalAccountKey(t *testing.T) {
939
939
case string (externalAccountKeyIDsByProvisionerIDTable ):
940
940
assert .Equals (t , provID , string (key ))
941
941
return nu , true , nil
942
- case string (externalAccountKeysByReferenceTable ):
942
+ case string (externalAccountKeyIDsByReferenceTable ):
943
943
assert .Equals (t , provID + "." + ref , string (key ))
944
944
assert .Equals (t , nil , old )
945
945
return nu , true , nil
@@ -973,7 +973,7 @@ func TestDB_CreateExternalAccountKey(t *testing.T) {
973
973
db : & certdb.MockNoSQLDB {
974
974
MCmpAndSwap : func (bucket , key , old , nu []byte ) ([]byte , bool , error ) {
975
975
switch string (bucket ) {
976
- case string (externalAccountKeysByReferenceTable ):
976
+ case string (externalAccountKeyIDsByReferenceTable ):
977
977
assert .Equals (t , string (key ), ref )
978
978
assert .Equals (t , old , nil )
979
979
return nu , true , nil
@@ -999,7 +999,7 @@ func TestDB_CreateExternalAccountKey(t *testing.T) {
999
999
},
1000
1000
MCmpAndSwap : func (bucket , key , old , nu []byte ) ([]byte , bool , error ) {
1001
1001
switch string (bucket ) {
1002
- case string (externalAccountKeysByReferenceTable ):
1002
+ case string (externalAccountKeyIDsByReferenceTable ):
1003
1003
assert .Equals (t , string (key ), ref )
1004
1004
assert .Equals (t , old , nil )
1005
1005
return nu , true , nil
@@ -1029,7 +1029,7 @@ func TestDB_CreateExternalAccountKey(t *testing.T) {
1029
1029
case string (externalAccountKeyIDsByProvisionerIDTable ):
1030
1030
assert .Equals (t , provID , string (key ))
1031
1031
return nu , true , nil
1032
- case string (externalAccountKeysByReferenceTable ):
1032
+ case string (externalAccountKeyIDsByReferenceTable ):
1033
1033
assert .Equals (t , provID + "." + ref , string (key ))
1034
1034
assert .Equals (t , old , nil )
1035
1035
return nu , true , errors .New ("force" )
@@ -1348,7 +1348,7 @@ func TestDB_addEAKID(t *testing.T) {
1348
1348
MCmpAndSwap : func (bucket , key , old , nu []byte ) ([]byte , bool , error ) {
1349
1349
assert .Equals (t , bucket , externalAccountKeyIDsByProvisionerIDTable )
1350
1350
assert .Equals (t , string (key ), provID )
1351
- assert .Equals (t , old , [] byte { 110 , 117 , 108 , 108 } )
1351
+ assert .Equals (t , old , nil )
1352
1352
b , _ := json .Marshal ([]string {eakID })
1353
1353
assert .Equals (t , nu , b )
1354
1354
return b , true , nil
@@ -1482,7 +1482,7 @@ func TestDB_deleteEAKID(t *testing.T) {
1482
1482
MCmpAndSwap : func (bucket , key , old , nu []byte ) ([]byte , bool , error ) {
1483
1483
assert .Equals (t , bucket , externalAccountKeyIDsByProvisionerIDTable )
1484
1484
assert .Equals (t , string (key ), provID )
1485
- assert .Equals (t , old , [] byte { 110 , 117 , 108 , 108 } )
1485
+ assert .Equals (t , old , nil )
1486
1486
b , _ := json .Marshal ([]string {})
1487
1487
assert .Equals (t , nu , b )
1488
1488
return b , true , nil
@@ -1579,7 +1579,7 @@ func TestDB_addAndDeleteEAKID(t *testing.T) {
1579
1579
assert .Equals (t , string (key ), provID )
1580
1580
switch callCounter {
1581
1581
case 0 :
1582
- assert .Equals (t , old , [] byte { 110 , 117 , 108 , 108 } )
1582
+ assert .Equals (t , old , nil )
1583
1583
newB , _ := json .Marshal ([]string {"eakID" })
1584
1584
assert .Equals (t , nu , newB )
1585
1585
return newB , true , nil
@@ -1589,8 +1589,7 @@ func TestDB_addAndDeleteEAKID(t *testing.T) {
1589
1589
newB , _ := json .Marshal ([]string {})
1590
1590
return newB , true , nil
1591
1591
case 2 :
1592
- oldB , _ := json .Marshal ([]string {})
1593
- assert .Equals (t , old , oldB )
1592
+ assert .Equals (t , old , nil )
1594
1593
newB , _ := json .Marshal ([]string {"eakID1" })
1595
1594
assert .Equals (t , nu , newB )
1596
1595
return newB , true , nil
0 commit comments