From 176829c4cc9ecaee445fd1cfa6ceebc8c13a76d4 Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Wed, 2 Nov 2016 13:44:09 +0100 Subject: [PATCH] Change ClusterState and PendingClusterTasksResponse's toString() to their prettyPrint format (elastic/elasticsearch#3947) Change ClusterState and PendingClusterTasksResponse's toString() to their prettyPrint format Original commit: elastic/x-pack-elasticsearch@4ea9d560587541dc5c36610176b269787454320f --- .../license/TribeTransportTestCase.java | 4 +-- .../audit/index/IndexAuditTrailTests.java | 26 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/elasticsearch/src/test/java/org/elasticsearch/license/TribeTransportTestCase.java b/elasticsearch/src/test/java/org/elasticsearch/license/TribeTransportTestCase.java index c734a8ff805..ad9e034c607 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/license/TribeTransportTestCase.java +++ b/elasticsearch/src/test/java/org/elasticsearch/license/TribeTransportTestCase.java @@ -207,8 +207,8 @@ public abstract class TribeTransportTestCase extends ESIntegTestCase { .waitForEvents(Priority.LANGUID).waitForNoRelocatingShards(true)).actionGet(); if (actionGet.isTimedOut()) { logger.info("ensureGreen timed out, cluster state:\n{}\n{}", testCluster.client().admin().cluster() - .prepareState().get().getState().prettyPrint(), - testCluster.client().admin().cluster().preparePendingClusterTasks().get().prettyPrint()); + .prepareState().get().getState(), + testCluster.client().admin().cluster().preparePendingClusterTasks().get()); assertThat("timed out waiting for yellow state", actionGet.isTimedOut(), equalTo(false)); } assertThat(actionGet.getStatus(), anyOf(equalTo(ClusterHealthStatus.YELLOW), equalTo(ClusterHealthStatus.GREEN))); diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java index 49495cc12cd..790936daac4 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java @@ -5,17 +5,6 @@ */ package org.elasticsearch.xpack.security.audit.index; -import java.io.IOException; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Set; -import java.util.function.Function; - import org.apache.lucene.util.SetOnce; import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; @@ -62,6 +51,17 @@ import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.function.Function; + import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE; import static org.elasticsearch.test.InternalTestCluster.clusterName; import static org.elasticsearch.xpack.security.audit.index.IndexNameResolver.Rollover.DAILY; @@ -801,8 +801,8 @@ public class IndexAuditTrailTests extends SecurityIntegTestCase { .waitForNoRelocatingShards(true).waitForYellowStatus().waitForEvents(Priority.LANGUID)).actionGet(); if (actionGet.isTimedOut()) { logger.info("ensureYellow timed out, cluster state:\n{}\n{}", - getClient().admin().cluster().prepareState().get().getState().prettyPrint(), - getClient().admin().cluster().preparePendingClusterTasks().get().prettyPrint()); + getClient().admin().cluster().prepareState().get().getState(), + getClient().admin().cluster().preparePendingClusterTasks().get()); assertThat("timed out waiting for yellow", actionGet.isTimedOut(), equalTo(false)); }