From d18ff24dbed6ec1bc74d452b3ae4c41fc0d263e9 Mon Sep 17 00:00:00 2001 From: Tim Brooks Date: Tue, 13 Aug 2019 19:44:39 -0400 Subject: [PATCH] Fix BulkByScrollResponseTests exception assertions (#45519) Currently in the x content serialization tests we compare the exception messages that are serialized. These exceptions messages are not equivalent because the exception often changes when serialized to x content. This commit removes this assertion. --- .../elasticsearch/index/reindex/BulkByScrollResponseTests.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollResponseTests.java b/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollResponseTests.java index a1301fe03eaf9..8791c11bf2745 100644 --- a/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollResponseTests.java +++ b/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollResponseTests.java @@ -40,7 +40,6 @@ import static java.util.Collections.singletonList; import static org.apache.lucene.util.TestUtil.randomSimpleString; import static org.elasticsearch.common.unit.TimeValue.timeValueMillis; -import static org.hamcrest.Matchers.containsString; public class BulkByScrollResponseTests extends AbstractXContentTestCase { @@ -121,7 +120,6 @@ public static void assertEqualBulkResponse(BulkByScrollResponse expected, BulkBy assertEquals(expectedFailure.getIndex(), actualFailure.getIndex()); assertEquals(expectedFailure.getType(), actualFailure.getType()); assertEquals(expectedFailure.getId(), actualFailure.getId()); - assertThat(expectedFailure.getMessage(), containsString(actualFailure.getMessage())); assertEquals(expectedFailure.getStatus(), actualFailure.getStatus()); } assertEquals(expected.getSearchFailures().size(), actual.getSearchFailures().size()); @@ -132,7 +130,6 @@ public static void assertEqualBulkResponse(BulkByScrollResponse expected, BulkBy assertEquals(expectedFailure.getShardId(), actualFailure.getShardId()); assertEquals(expectedFailure.getNodeId(), actualFailure.getNodeId()); assertEquals(expectedFailure.getStatus(), actualFailure.getStatus()); - assertThat(actualFailure.getReason().getMessage(), containsString(expectedFailure.getReason().getMessage())); } }