@@ -21,8 +21,7 @@ public BulkInvalidVersionApiTests(WritableCluster cluster, EndpointUsage usage)
2121 {
2222 new Dictionary < string , object > { { "index" , new { _type = "doc" , _id = Project . Instance . Name , routing = Project . Instance . Name } } } ,
2323 Project . InstanceAnonymous ,
24- new Dictionary < string , object >
25- { { "index" , new { _type = "doc" , _id = Project . Instance . Name , routing = Project . Instance . Name , version = 0 } } } ,
24+ new Dictionary < string , object > { { "index" , new { _type = "doc" , _id = Project . Instance . Name , routing = Project . Instance . Name , if_seq_no = - 1 , if_primary_term = 0 } } } ,
2625 Project . InstanceAnonymous ,
2726 } ;
2827
@@ -31,7 +30,7 @@ public BulkInvalidVersionApiTests(WritableCluster cluster, EndpointUsage usage)
3130 protected override Func < BulkDescriptor , IBulkRequest > Fluent => d => d
3231 . Index ( CallIsolatedValue )
3332 . Index < Project > ( i => i . Document ( Project . Instance ) )
34- . Index < Project > ( i => i . Version ( 0 ) . Document ( Project . Instance ) ) ;
33+ . Index < Project > ( i => i . IfSequenceNumber ( - 1 ) . IfPrimaryTerm ( 0 ) . Document ( Project . Instance ) ) ;
3534
3635 protected override HttpMethod HttpMethod => HttpMethod . POST ;
3736
@@ -41,7 +40,7 @@ public BulkInvalidVersionApiTests(WritableCluster cluster, EndpointUsage usage)
4140 Operations = new List < IBulkOperation >
4241 {
4342 new BulkIndexOperation < Project > ( Project . Instance ) ,
44- new BulkIndexOperation < Project > ( Project . Instance ) { Version = 0 }
43+ new BulkIndexOperation < Project > ( Project . Instance ) { IfSequenceNumber = - 1 , IfPrimaryTerm = 0 }
4544 }
4645 } ;
4746
@@ -60,8 +59,8 @@ protected override void ExpectResponse(IBulkResponse response)
6059 response . ShouldNotBeValid ( ) ;
6160 response . ServerError . Should ( ) . NotBeNull ( ) ;
6261 response . ServerError . Status . Should ( ) . Be ( 400 ) ;
63- response . ServerError . Error . Type . Should ( ) . Be ( "action_request_validation_exception " ) ;
64- response . ServerError . Error . Reason . Should ( ) . EndWith ( "illegal version value [0] for version type [INTERNAL]; ") ;
62+ response . ServerError . Error . Type . Should ( ) . Be ( "illegal_argument_exception " ) ;
63+ response . ServerError . Error . Reason . Should ( ) . Contain ( "sequence numbers must be non negative. ") ;
6564 }
6665 }
6766}
0 commit comments