Skip to content

Commit c9e6524

Browse files
committed
Transpose expected and actual, and remove duplicate info from message.
Previously: ``` > Throwable #1: java.lang.AssertionError: Expected all shards successful but got successful [8] total [9] > Expected: <8> > but: was <9> ``` Now: ``` > Throwable #1: java.lang.AssertionError: Expected all shards successful > Expected: <9> > but: was <8> ```
1 parent b5c3e08 commit c9e6524

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/framework/src/main/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertions.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,15 +346,15 @@ public static void assertNoFailures(BroadcastResponse response) {
346346

347347
public static void assertAllSuccessful(BroadcastResponse response) {
348348
assertNoFailures(response);
349-
assertThat("Expected all shards successful but got successful [" + response.getSuccessfulShards() + "] total [" + response.getTotalShards() + "]",
350-
response.getTotalShards(), equalTo(response.getSuccessfulShards()));
349+
assertThat("Expected all shards successful",
350+
response.getSuccessfulShards(), equalTo(response.getTotalShards()));
351351
assertVersionSerializable(response);
352352
}
353353

354354
public static void assertAllSuccessful(SearchResponse response) {
355355
assertNoFailures(response);
356-
assertThat("Expected all shards successful but got successful [" + response.getSuccessfulShards() + "] total [" + response.getTotalShards() + "]",
357-
response.getTotalShards(), equalTo(response.getSuccessfulShards()));
356+
assertThat("Expected all shards successful",
357+
response.getSuccessfulShards(), equalTo(response.getTotalShards()));
358358
assertVersionSerializable(response);
359359
}
360360

0 commit comments

Comments
 (0)