[TEST] Fix JSON generation of failure in InternalTestCluster

Relates to #22387
This commit is contained in:
Yannick Welsch 2017-01-10 17:49:23 +01:00
parent d7cc6e28e7
commit c35277e623
1 changed files with 1 additions and 6 deletions

View File

@ -1146,13 +1146,8 @@ public final class InternalTestCluster extends TestCluster {
.map(task -> task.taskInfo(localNode.getId(), true))
.collect(Collectors.toList());
ListTasksResponse response = new ListTasksResponse(taskInfos, Collections.emptyList(), Collections.emptyList());
XContentBuilder builder = null;
try {
builder = XContentFactory.jsonBuilder()
.prettyPrint()
.startObject()
.value(response)
.endObject();
XContentBuilder builder = XContentFactory.jsonBuilder().prettyPrint().value(response);
throw new AssertionError("expected index shard counter on shard " + indexShard.shardId() + " on node " +
nodeAndClient.name + " to be 0 but was " + activeOperationsCount + ". Current replication tasks on node:\n" +
builder.string());