@@ -466,7 +466,7 @@ func TestChangesVersionType(t *testing.T) {
466466 changesRequestQueryParams string
467467 changesRequestBody string
468468 expectedStatus int
469- expectedVersionType string
469+ expectedVersionType db. ChangesVersionType
470470 expectedDocs int
471471 }{
472472 {
@@ -480,39 +480,39 @@ func TestChangesVersionType(t *testing.T) {
480480 changesRequestMethod : http .MethodGet ,
481481 changesRequestQueryParams : "" ,
482482 expectedStatus : http .StatusOK ,
483- expectedVersionType : "rev" ,
483+ expectedVersionType : db . ChangesVersionTypeRevTreeID ,
484484 expectedDocs : 2 ,
485485 },
486486 {
487487 name : "rev version_type" ,
488488 changesRequestMethod : http .MethodGet ,
489489 changesRequestQueryParams : "?version_type=rev" ,
490490 expectedStatus : http .StatusOK ,
491- expectedVersionType : "rev" ,
491+ expectedVersionType : db . ChangesVersionTypeRevTreeID ,
492492 expectedDocs : 2 ,
493493 },
494494 {
495495 name : "cv version_type" ,
496496 changesRequestMethod : http .MethodGet ,
497497 changesRequestQueryParams : "?version_type=cv" ,
498498 expectedStatus : http .StatusOK ,
499- expectedVersionType : "cv" ,
499+ expectedVersionType : db . ChangesVersionTypeCV ,
500500 expectedDocs : 2 ,
501501 },
502502 {
503503 name : "rev docid filter" ,
504504 changesRequestMethod : http .MethodGet ,
505505 changesRequestQueryParams : "?version_type=rev&filter=_doc_ids&doc_ids=doc1" ,
506506 expectedStatus : http .StatusOK ,
507- expectedVersionType : "rev" ,
507+ expectedVersionType : db . ChangesVersionTypeRevTreeID ,
508508 expectedDocs : 1 ,
509509 },
510510 {
511511 name : "cv docid filter" ,
512512 changesRequestMethod : http .MethodGet ,
513513 changesRequestQueryParams : "?version_type=cv&filter=_doc_ids&doc_ids=doc1" ,
514514 expectedStatus : http .StatusOK ,
515- expectedVersionType : "cv" ,
515+ expectedVersionType : db . ChangesVersionTypeCV ,
516516 expectedDocs : 1 ,
517517 },
518518 {
@@ -521,7 +521,7 @@ func TestChangesVersionType(t *testing.T) {
521521 changesRequestQueryParams : "" ,
522522 changesRequestBody : `{"version_type":"rev"}` ,
523523 expectedStatus : http .StatusOK ,
524- expectedVersionType : "rev" ,
524+ expectedVersionType : db . ChangesVersionTypeRevTreeID ,
525525 expectedDocs : 2 ,
526526 },
527527 {
@@ -530,7 +530,7 @@ func TestChangesVersionType(t *testing.T) {
530530 changesRequestQueryParams : "" ,
531531 changesRequestBody : `{"version_type":"cv"}` ,
532532 expectedStatus : http .StatusOK ,
533- expectedVersionType : "cv" ,
533+ expectedVersionType : db . ChangesVersionTypeCV ,
534534 expectedDocs : 2 ,
535535 },
536536 {
@@ -539,7 +539,7 @@ func TestChangesVersionType(t *testing.T) {
539539 changesRequestQueryParams : "" ,
540540 changesRequestBody : `{"version_type":"cv", "filter":"_doc_ids", "doc_ids":["doc1"]}` ,
541541 expectedStatus : http .StatusOK ,
542- expectedVersionType : "cv" ,
542+ expectedVersionType : db . ChangesVersionTypeCV ,
543543 expectedDocs : 1 ,
544544 },
545545 }
@@ -563,7 +563,7 @@ func TestChangesVersionType(t *testing.T) {
563563 for _ , change := range changeEntry .Changes {
564564 require .Len (t , change , 1 ) // ensure only one version type is present
565565 // and that it was the expected one (and we have a value)
566- versionValue , ok := change [db . ChangesVersionType ( test .expectedVersionType ) ]
566+ versionValue , ok := change [test .expectedVersionType ]
567567 require .Truef (t , ok , "Expected version type %s, got %v" , test .expectedVersionType , change )
568568 require .NotEmpty (t , versionValue )
569569 }
0 commit comments