From c8680f997b2635159940b4a8f5888e146c87d1b6 Mon Sep 17 00:00:00 2001 From: Albert Zaharovits Date: Wed, 8 Jan 2025 18:40:57 +0200 Subject: [PATCH] Fix RestShardsActionTests --- .../action/cat/RestShardsActionTests.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/rest/action/cat/RestShardsActionTests.java b/server/src/test/java/org/elasticsearch/rest/action/cat/RestShardsActionTests.java index cc5e65ad2fade..8b4ecac4ada53 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/cat/RestShardsActionTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/cat/RestShardsActionTests.java @@ -78,8 +78,8 @@ public void testBuildTable() { assertThat(row.get(3).value, equalTo(shardRouting.state())); assertThat(row.get(7).value, equalTo(localNode.getHostAddress())); assertThat(row.get(8).value, equalTo(localNode.getId())); - assertThat(row.get(70).value, equalTo(shardStats.getDataPath())); - assertThat(row.get(71).value, equalTo(shardStats.getStatePath())); + assertThat(row.get(71).value, equalTo(shardStats.getDataPath())); + assertThat(row.get(72).value, equalTo(shardStats.getStatePath())); } } @@ -91,14 +91,14 @@ public void testShardStatsForIndexing() { // now, verify the table is correct List headers = table.getHeaders(); - assertThat(headers.get(29).value, equalTo("indexing.delete_current")); - assertThat(headers.get(30).value, equalTo("indexing.delete_time")); - assertThat(headers.get(31).value, equalTo("indexing.delete_total")); - assertThat(headers.get(32).value, equalTo("indexing.index_current")); - assertThat(headers.get(33).value, equalTo("indexing.index_time")); - assertThat(headers.get(34).value, equalTo("indexing.index_total")); - assertThat(headers.get(35).value, equalTo("indexing.index_failed")); - assertThat(headers.get(36).value, equalTo("indexing.index_failed_due_to_version_conflict")); + assertThat(headers.get(30).value, equalTo("indexing.delete_current")); + assertThat(headers.get(31).value, equalTo("indexing.delete_time")); + assertThat(headers.get(32).value, equalTo("indexing.delete_total")); + assertThat(headers.get(33).value, equalTo("indexing.index_current")); + assertThat(headers.get(34).value, equalTo("indexing.index_time")); + assertThat(headers.get(35).value, equalTo("indexing.index_total")); + assertThat(headers.get(36).value, equalTo("indexing.index_failed")); + assertThat(headers.get(37).value, equalTo("indexing.index_failed_due_to_version_conflict")); final List> rows = table.getRows(); assertThat(rows.size(), equalTo(shardRoutings.size())); @@ -107,15 +107,15 @@ public void testShardStatsForIndexing() { for (final List row : rows) { ShardRouting shardRouting = shardRoutingsIt.next(); ShardStats shardStats = indicesStatsResponse.asMap().get(shardRouting); - assertThat(row.get(29).value, equalTo(shardStats.getStats().getIndexing().getTotal().getDeleteCurrent())); - assertThat(row.get(30).value, equalTo(shardStats.getStats().getIndexing().getTotal().getDeleteTime())); - assertThat(row.get(31).value, equalTo(shardStats.getStats().getIndexing().getTotal().getDeleteCount())); - assertThat(row.get(32).value, equalTo(shardStats.getStats().getIndexing().getTotal().getIndexCurrent())); - assertThat(row.get(33).value, equalTo(shardStats.getStats().getIndexing().getTotal().getIndexTime())); - assertThat(row.get(34).value, equalTo(shardStats.getStats().getIndexing().getTotal().getIndexCount())); - assertThat(row.get(35).value, equalTo(shardStats.getStats().getIndexing().getTotal().getIndexFailedCount())); + assertThat(row.get(30).value, equalTo(shardStats.getStats().getIndexing().getTotal().getDeleteCurrent())); + assertThat(row.get(31).value, equalTo(shardStats.getStats().getIndexing().getTotal().getDeleteTime())); + assertThat(row.get(32).value, equalTo(shardStats.getStats().getIndexing().getTotal().getDeleteCount())); + assertThat(row.get(33).value, equalTo(shardStats.getStats().getIndexing().getTotal().getIndexCurrent())); + assertThat(row.get(34).value, equalTo(shardStats.getStats().getIndexing().getTotal().getIndexTime())); + assertThat(row.get(35).value, equalTo(shardStats.getStats().getIndexing().getTotal().getIndexCount())); + assertThat(row.get(36).value, equalTo(shardStats.getStats().getIndexing().getTotal().getIndexFailedCount())); assertThat( - row.get(36).value, + row.get(37).value, equalTo(shardStats.getStats().getIndexing().getTotal().getIndexFailedDueToVersionConflictCount()) ); }