@@ -91,7 +91,7 @@ func TestDBBadConnectionDef(t *testing.T) {
91
91
92
92
func TestDBCreateSaveWithoutRevision (t * testing.T ) {
93
93
94
- if ledgerconfig .IsCouchDBEnabled () == true {
94
+ if ledgerconfig .IsCouchDBEnabled () {
95
95
96
96
database := "testdbcreatesavewithoutrevision"
97
97
err := cleanup (database )
@@ -117,7 +117,7 @@ func TestDBCreateSaveWithoutRevision(t *testing.T) {
117
117
118
118
func TestDBCreateEnsureFullCommit (t * testing.T ) {
119
119
120
- if ledgerconfig .IsCouchDBEnabled () == true {
120
+ if ledgerconfig .IsCouchDBEnabled () {
121
121
122
122
database := "testdbensurefullcommit"
123
123
err := cleanup (database )
@@ -148,7 +148,7 @@ func TestDBCreateEnsureFullCommit(t *testing.T) {
148
148
149
149
func TestDBBadDatabaseName (t * testing.T ) {
150
150
151
- if ledgerconfig .IsCouchDBEnabled () == true {
151
+ if ledgerconfig .IsCouchDBEnabled () {
152
152
153
153
//create a new instance and database object using a valid database name mixed case
154
154
couchInstance , err := CreateCouchInstance (connectURL , username , password )
@@ -187,7 +187,7 @@ func TestDBBadConnection(t *testing.T) {
187
187
// TODO Re-enable once configurable retry logic is introduced
188
188
t .Skip ()
189
189
190
- if ledgerconfig .IsCouchDBEnabled () == true {
190
+ if ledgerconfig .IsCouchDBEnabled () {
191
191
192
192
//create a new instance and database object
193
193
_ , err := CreateCouchInstance (badConnectURL , username , password )
@@ -197,7 +197,7 @@ func TestDBBadConnection(t *testing.T) {
197
197
198
198
func TestDBCreateDatabaseAndPersist (t * testing.T ) {
199
199
200
- if ledgerconfig .IsCouchDBEnabled () == true {
200
+ if ledgerconfig .IsCouchDBEnabled () {
201
201
202
202
database := "testdbcreatedatabaseandpersist"
203
203
err := cleanup (database )
@@ -286,7 +286,7 @@ func TestDBCreateDatabaseAndPersist(t *testing.T) {
286
286
287
287
func TestDBBadJSON (t * testing.T ) {
288
288
289
- if ledgerconfig .IsCouchDBEnabled () == true {
289
+ if ledgerconfig .IsCouchDBEnabled () {
290
290
291
291
database := "testdbbadjson"
292
292
err := cleanup (database )
@@ -322,7 +322,7 @@ func TestDBBadJSON(t *testing.T) {
322
322
}
323
323
324
324
func TestPrefixScan (t * testing.T ) {
325
- if ! ledgerconfig .IsCouchDBEnabled () == true {
325
+ if ! ledgerconfig .IsCouchDBEnabled () {
326
326
return
327
327
}
328
328
database := "testprefixscan"
@@ -384,7 +384,7 @@ func TestPrefixScan(t *testing.T) {
384
384
385
385
func TestDBSaveAttachment (t * testing.T ) {
386
386
387
- if ledgerconfig .IsCouchDBEnabled () == true {
387
+ if ledgerconfig .IsCouchDBEnabled () {
388
388
389
389
database := "testdbsaveattachment"
390
390
err := cleanup (database )
@@ -395,12 +395,12 @@ func TestDBSaveAttachment(t *testing.T) {
395
395
396
396
byteText := []byte (`This is a test document. This is only a test` )
397
397
398
- attachment := Attachment {}
398
+ attachment := & Attachment {}
399
399
attachment .AttachmentBytes = byteText
400
400
attachment .ContentType = "text/plain"
401
401
attachment .Name = "valueBytes"
402
402
403
- attachments := []Attachment {}
403
+ attachments := []* Attachment {}
404
404
attachments = append (attachments , attachment )
405
405
406
406
//create a new instance and database object
@@ -428,7 +428,7 @@ func TestDBSaveAttachment(t *testing.T) {
428
428
429
429
func TestDBDeleteDocument (t * testing.T ) {
430
430
431
- if ledgerconfig .IsCouchDBEnabled () == true {
431
+ if ledgerconfig .IsCouchDBEnabled () {
432
432
433
433
database := "testdbdeletedocument"
434
434
err := cleanup (database )
@@ -466,7 +466,7 @@ func TestDBDeleteDocument(t *testing.T) {
466
466
467
467
func TestDBDeleteNonExistingDocument (t * testing.T ) {
468
468
469
- if ledgerconfig .IsCouchDBEnabled () == true {
469
+ if ledgerconfig .IsCouchDBEnabled () {
470
470
471
471
database := "testdbdeletenonexistingdocument"
472
472
err := cleanup (database )
@@ -508,7 +508,7 @@ func TestCouchDBVersion(t *testing.T) {
508
508
509
509
func TestRichQuery (t * testing.T ) {
510
510
511
- if ledgerconfig .IsCouchDBEnabled () == true {
511
+ if ledgerconfig .IsCouchDBEnabled () {
512
512
513
513
byteJSON01 := []byte (`{"asset_name":"marble01","color":"blue","size":1,"owner":"jerry"}` )
514
514
byteJSON02 := []byte (`{"asset_name":"marble02","color":"red","size":2,"owner":"tom"}` )
@@ -527,85 +527,85 @@ func TestRichQuery(t *testing.T) {
527
527
attachment1 .AttachmentBytes = []byte (`marble01 - test attachment` )
528
528
attachment1 .ContentType = "application/octet-stream"
529
529
attachment1 .Name = "data"
530
- attachments1 := []Attachment {}
531
- attachments1 = append (attachments1 , * attachment1 )
530
+ attachments1 := []* Attachment {}
531
+ attachments1 = append (attachments1 , attachment1 )
532
532
533
533
attachment2 := & Attachment {}
534
534
attachment2 .AttachmentBytes = []byte (`marble02 - test attachment` )
535
535
attachment2 .ContentType = "application/octet-stream"
536
536
attachment2 .Name = "data"
537
- attachments2 := []Attachment {}
538
- attachments2 = append (attachments2 , * attachment2 )
537
+ attachments2 := []* Attachment {}
538
+ attachments2 = append (attachments2 , attachment2 )
539
539
540
540
attachment3 := & Attachment {}
541
541
attachment3 .AttachmentBytes = []byte (`marble03 - test attachment` )
542
542
attachment3 .ContentType = "application/octet-stream"
543
543
attachment3 .Name = "data"
544
- attachments3 := []Attachment {}
545
- attachments3 = append (attachments3 , * attachment3 )
544
+ attachments3 := []* Attachment {}
545
+ attachments3 = append (attachments3 , attachment3 )
546
546
547
547
attachment4 := & Attachment {}
548
548
attachment4 .AttachmentBytes = []byte (`marble04 - test attachment` )
549
549
attachment4 .ContentType = "application/octet-stream"
550
550
attachment4 .Name = "data"
551
- attachments4 := []Attachment {}
552
- attachments4 = append (attachments4 , * attachment4 )
551
+ attachments4 := []* Attachment {}
552
+ attachments4 = append (attachments4 , attachment4 )
553
553
554
554
attachment5 := & Attachment {}
555
555
attachment5 .AttachmentBytes = []byte (`marble05 - test attachment` )
556
556
attachment5 .ContentType = "application/octet-stream"
557
557
attachment5 .Name = "data"
558
- attachments5 := []Attachment {}
559
- attachments5 = append (attachments5 , * attachment5 )
558
+ attachments5 := []* Attachment {}
559
+ attachments5 = append (attachments5 , attachment5 )
560
560
561
561
attachment6 := & Attachment {}
562
562
attachment6 .AttachmentBytes = []byte (`marble06 - test attachment` )
563
563
attachment6 .ContentType = "application/octet-stream"
564
564
attachment6 .Name = "data"
565
- attachments6 := []Attachment {}
566
- attachments6 = append (attachments6 , * attachment6 )
565
+ attachments6 := []* Attachment {}
566
+ attachments6 = append (attachments6 , attachment6 )
567
567
568
568
attachment7 := & Attachment {}
569
569
attachment7 .AttachmentBytes = []byte (`marble07 - test attachment` )
570
570
attachment7 .ContentType = "application/octet-stream"
571
571
attachment7 .Name = "data"
572
- attachments7 := []Attachment {}
573
- attachments7 = append (attachments7 , * attachment7 )
572
+ attachments7 := []* Attachment {}
573
+ attachments7 = append (attachments7 , attachment7 )
574
574
575
575
attachment8 := & Attachment {}
576
576
attachment8 .AttachmentBytes = []byte (`marble08 - test attachment` )
577
577
attachment8 .ContentType = "application/octet-stream"
578
578
attachment7 .Name = "data"
579
- attachments8 := []Attachment {}
580
- attachments8 = append (attachments8 , * attachment8 )
579
+ attachments8 := []* Attachment {}
580
+ attachments8 = append (attachments8 , attachment8 )
581
581
582
582
attachment9 := & Attachment {}
583
583
attachment9 .AttachmentBytes = []byte (`marble09 - test attachment` )
584
584
attachment9 .ContentType = "application/octet-stream"
585
585
attachment9 .Name = "data"
586
- attachments9 := []Attachment {}
587
- attachments9 = append (attachments9 , * attachment9 )
586
+ attachments9 := []* Attachment {}
587
+ attachments9 = append (attachments9 , attachment9 )
588
588
589
589
attachment10 := & Attachment {}
590
590
attachment10 .AttachmentBytes = []byte (`marble10 - test attachment` )
591
591
attachment10 .ContentType = "application/octet-stream"
592
592
attachment10 .Name = "data"
593
- attachments10 := []Attachment {}
594
- attachments10 = append (attachments10 , * attachment10 )
593
+ attachments10 := []* Attachment {}
594
+ attachments10 = append (attachments10 , attachment10 )
595
595
596
596
attachment11 := & Attachment {}
597
597
attachment11 .AttachmentBytes = []byte (`marble11 - test attachment` )
598
598
attachment11 .ContentType = "application/octet-stream"
599
599
attachment11 .Name = "data"
600
- attachments11 := []Attachment {}
601
- attachments11 = append (attachments11 , * attachment11 )
600
+ attachments11 := []* Attachment {}
601
+ attachments11 = append (attachments11 , attachment11 )
602
602
603
603
attachment12 := & Attachment {}
604
604
attachment12 .AttachmentBytes = []byte (`marble12 - test attachment` )
605
605
attachment12 .ContentType = "application/octet-stream"
606
606
attachment12 .Name = "data"
607
- attachments12 := []Attachment {}
608
- attachments12 = append (attachments12 , * attachment12 )
607
+ attachments12 := []* Attachment {}
608
+ attachments12 = append (attachments12 , attachment12 )
609
609
610
610
database := "testrichquery"
611
611
err := cleanup (database )
@@ -779,7 +779,7 @@ func TestRichQuery(t *testing.T) {
779
779
780
780
func TestBatchBatchOperations (t * testing.T ) {
781
781
782
- if ledgerconfig .IsCouchDBEnabled () == true {
782
+ if ledgerconfig .IsCouchDBEnabled () {
783
783
784
784
byteJSON01 := []byte (`{"_id":"marble01","asset_name":"marble01","color":"blue","size":"1","owner":"jerry"}` )
785
785
byteJSON02 := []byte (`{"_id":"marble02","asset_name":"marble02","color":"red","size":"2","owner":"tom"}` )
@@ -791,36 +791,36 @@ func TestBatchBatchOperations(t *testing.T) {
791
791
attachment1 .AttachmentBytes = []byte (`marble01 - test attachment` )
792
792
attachment1 .ContentType = "application/octet-stream"
793
793
attachment1 .Name = "data"
794
- attachments1 := []Attachment {}
795
- attachments1 = append (attachments1 , * attachment1 )
794
+ attachments1 := []* Attachment {}
795
+ attachments1 = append (attachments1 , attachment1 )
796
796
797
797
attachment2 := & Attachment {}
798
798
attachment2 .AttachmentBytes = []byte (`marble02 - test attachment` )
799
799
attachment2 .ContentType = "application/octet-stream"
800
800
attachment2 .Name = "data"
801
- attachments2 := []Attachment {}
802
- attachments2 = append (attachments2 , * attachment2 )
801
+ attachments2 := []* Attachment {}
802
+ attachments2 = append (attachments2 , attachment2 )
803
803
804
804
attachment3 := & Attachment {}
805
805
attachment3 .AttachmentBytes = []byte (`marble03 - test attachment` )
806
806
attachment3 .ContentType = "application/octet-stream"
807
807
attachment3 .Name = "data"
808
- attachments3 := []Attachment {}
809
- attachments3 = append (attachments3 , * attachment3 )
808
+ attachments3 := []* Attachment {}
809
+ attachments3 = append (attachments3 , attachment3 )
810
810
811
811
attachment4 := & Attachment {}
812
812
attachment4 .AttachmentBytes = []byte (`marble04 - test attachment` )
813
813
attachment4 .ContentType = "application/octet-stream"
814
814
attachment4 .Name = "data"
815
- attachments4 := []Attachment {}
816
- attachments4 = append (attachments4 , * attachment4 )
815
+ attachments4 := []* Attachment {}
816
+ attachments4 = append (attachments4 , attachment4 )
817
817
818
818
attachment5 := & Attachment {}
819
819
attachment5 .AttachmentBytes = []byte (`marble05 - test attachment` )
820
820
attachment5 .ContentType = "application/octet-stream"
821
821
attachment5 .Name = "data"
822
- attachments5 := []Attachment {}
823
- attachments5 = append (attachments5 , * attachment5 )
822
+ attachments5 := []* Attachment {}
823
+ attachments5 = append (attachments5 , attachment5 )
824
824
825
825
database := "testbatch"
826
826
err := cleanup (database )
0 commit comments