Skip to content

Commit

Permalink
Transpose expected and actual, and remove duplicate info from message.
Browse files Browse the repository at this point in the history
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>
```
  • Loading branch information
DaveCTurner committed Nov 24, 2017
1 parent 43a91f4 commit ea98ddc
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,15 @@ public static void assertNoFailures(BroadcastResponse response) {

public static void assertAllSuccessful(BroadcastResponse response) {
assertNoFailures(response);
assertThat("Expected all shards successful but got successful [" + response.getSuccessfulShards() + "] total [" + response.getTotalShards() + "]",
response.getTotalShards(), equalTo(response.getSuccessfulShards()));
assertThat("Expected all shards successful",
response.getSuccessfulShards(), equalTo(response.getTotalShards()));
assertVersionSerializable(response);
}

public static void assertAllSuccessful(SearchResponse response) {
assertNoFailures(response);
assertThat("Expected all shards successful but got successful [" + response.getSuccessfulShards() + "] total [" + response.getTotalShards() + "]",
response.getTotalShards(), equalTo(response.getSuccessfulShards()));
assertThat("Expected all shards successful",
response.getSuccessfulShards(), equalTo(response.getTotalShards()));
assertVersionSerializable(response);
}

Expand Down

0 comments on commit ea98ddc

Please sign in to comment.