19
19
20
20
package org .elasticsearch .action .delete ;
21
21
22
+ import org .elasticsearch .action .DocWriteResponse .Result ;
22
23
import org .elasticsearch .action .support .replication .ReplicationResponse ;
23
24
import org .elasticsearch .common .Strings ;
24
25
import org .elasticsearch .common .bytes .BytesReference ;
@@ -42,13 +43,13 @@ public class DeleteResponseTests extends ESTestCase {
42
43
43
44
public void testToXContent () {
44
45
{
45
- DeleteResponse response = new DeleteResponse (new ShardId ("index" , "index_uuid" , 0 ), "type" , "id" , 3 , 17 , 5 , true );
46
+ DeleteResponse response = new DeleteResponse (new ShardId ("index" , "index_uuid" , 0 ), "type" , "id" , 3 , 17 , 5 , Result . DELETED );
46
47
String output = Strings .toString (response );
47
48
assertEquals ("{\" _index\" :\" index\" ,\" _type\" :\" type\" ,\" _id\" :\" id\" ,\" _version\" :5,\" result\" :\" deleted\" ," +
48
49
"\" _shards\" :null,\" _seq_no\" :3,\" _primary_term\" :17}" , output );
49
50
}
50
51
{
51
- DeleteResponse response = new DeleteResponse (new ShardId ("index" , "index_uuid" , 0 ), "type" , "id" , -1 , 0 , 7 , true );
52
+ DeleteResponse response = new DeleteResponse (new ShardId ("index" , "index_uuid" , 0 ), "type" , "id" , -1 , 0 , 7 , Result . DELETED );
52
53
response .setForcedRefresh (true );
53
54
response .setShardInfo (new ReplicationResponse .ShardInfo (10 , 5 ));
54
55
String output = Strings .toString (response );
@@ -122,12 +123,13 @@ public static Tuple<DeleteResponse, DeleteResponse> randomDeleteResponse() {
122
123
123
124
Tuple <ReplicationResponse .ShardInfo , ReplicationResponse .ShardInfo > shardInfos = RandomObjects .randomShardInfo (random ());
124
125
125
- DeleteResponse actual = new DeleteResponse (new ShardId (index , indexUUid , shardId ), type , id , seqNo , primaryTerm , version , found );
126
+ DeleteResponse actual = new DeleteResponse (new ShardId (index , indexUUid , shardId ), type , id , seqNo , primaryTerm , version ,
127
+ Result .DELETED );
126
128
actual .setForcedRefresh (forcedRefresh );
127
129
actual .setShardInfo (shardInfos .v1 ());
128
130
129
131
DeleteResponse expected =
130
- new DeleteResponse (new ShardId (index , INDEX_UUID_NA_VALUE , -1 ), type , id , seqNo , primaryTerm , version , found );
132
+ new DeleteResponse (new ShardId (index , INDEX_UUID_NA_VALUE , -1 ), type , id , seqNo , primaryTerm , version , Result . DELETED );
131
133
expected .setForcedRefresh (forcedRefresh );
132
134
expected .setShardInfo (shardInfos .v2 ());
133
135
0 commit comments