Repository: assertj/assertj (Java)

Issue:
Throw AssertionFailedError instead of AssertionError in non-strict string assertions
#### Summary
Throwing AssertionFailedError from opentest4j facilitates test failure analysis in IDE providing handy "diff" view.
AssertJ already uses AssertionFailedError (if available on the classpath) but not in non-strict string assertions (from AbstractCharSequenceAssert), specifically:
* isEqualToIgnoringNewLines
* isEqualToIgnoringWhitespace
* isEqualToIgnoringNewLines

Given that two of them mention new lines it is rather common to use them to compare long multi-line strings, and IDE's "diff" feature would be very helpful to nitpick some single-letter difference in big texts (possibly coming from files).

#### Example

```java
String generatedText = sut.generateText();
assertThat(generatedText).isEqualToNormalizingNewlines(loadText("expected.txt"));
```
![image](https://user-images.githubusercontent.com/2374036/46114945-98d85080-c1fd-11e8-87a2-9cc52e0eed3e.png)



Hints:

Patch:
diff --git a/src/main/java/org/assertj/core/internal/Strings.java b/src/main/java/org/assertj/core/internal/Strings.java
--- a/src/main/java/org/assertj/core/internal/Strings.java
+++ b/src/main/java/org/assertj/core/internal/Strings.java
@@ -550,7 +550,7 @@ private void checkCharSequenceIsNotNull(CharSequence sequence) {
    * @throws AssertionError if the given {@code CharSequence}s are not equal.
    */
   public void assertEqualsIgnoringCase(AssertionInfo info, CharSequence actual, CharSequence expected) {
-    if (!areEqualIgnoringCase(actual, expected)) throw failures.failure(info, shouldBeEqual(actual, expected));
+    if (!areEqualIgnoringCase(actual, expected)) throw failures.failure(info, shouldBeEqual(actual, expected), actual, expected);
   }
 
   /**
@@ -584,7 +584,7 @@ public void assertIsEqualToNormalizingNewlines(AssertionInfo info, CharSequence
     String actualNormalized = normalizeNewlines(actual);
     String expectedNormalized = normalizeNewlines(expected);
     if (!actualNormalized.equals(expectedNormalized))
-      throw failures.failure(info, shouldBeEqualIgnoringNewLineDifferences(actual, expected));
+      throw failures.failure(info, shouldBeEqualIgnoringNewLineDifferences(actual, expected), actual, expected);
   }
 
   private static String normalizeNewlines(CharSequence actual) {
@@ -601,7 +601,7 @@ private static String normalizeNewlines(CharSequence actual) {
    */
   public void assertEqualsIgnoringWhitespace(AssertionInfo info, CharSequence actual, CharSequence expected) {
     if (!areEqualIgnoringWhitespace(actual, expected))
-      throw failures.failure(info, shouldBeEqualIgnoringWhitespace(actual, expected));
+      throw failures.failure(info, shouldBeEqualIgnoringWhitespace(actual, expected), actual, expected);
   }
 
   /**
@@ -647,7 +647,7 @@ private String removeAllWhitespaces(CharSequence toBeStripped) {
    */
   public void assertEqualsNormalizingWhitespace(AssertionInfo info, CharSequence actual, CharSequence expected) {
     if (!areEqualNormalizingWhitespace(actual, expected))
-      throw failures.failure(info, shouldBeEqualNormalizingWhitespace(actual, expected));
+      throw failures.failure(info, shouldBeEqualNormalizingWhitespace(actual, expected), actual, expected);
   }
 
   /**
@@ -1084,7 +1084,7 @@ public void assertIsEqualToIgnoringNewLines(AssertionInfo info, CharSequence act
     String actualWithoutNewLines = removeNewLines(actual);
     String expectedWithoutNewLines = removeNewLines(expected);
     if (!actualWithoutNewLines.equals(expectedWithoutNewLines))
-      throw failures.failure(info, shouldBeEqualIgnoringNewLines(actual, expected));
+      throw failures.failure(info, shouldBeEqualIgnoringNewLines(actual, expected), actual, expected);
   }
 
   public void assertLowerCase(AssertionInfo info, CharSequence actual) {


Test patch:
diff --git a/src/test/java/org/assertj/core/internal/strings/Strings_assertEqualsIgnoringWhitespace_Test.java b/src/test/java/org/assertj/core/internal/strings/Strings_assertEqualsIgnoringWhitespace_Test.java
--- a/src/test/java/org/assertj/core/internal/strings/Strings_assertEqualsIgnoringWhitespace_Test.java
+++ b/src/test/java/org/assertj/core/internal/strings/Strings_assertEqualsIgnoringWhitespace_Test.java
@@ -94,6 +94,6 @@ public static Stream<Arguments> equalIgnoringWhitespaceGenerator() {
 
   private void verifyFailureThrownWhenStringsAreNotEqualIgnoringWhitespace(AssertionInfo info, String actual,
                                                                            String expected) {
-    verify(failures).failure(info, shouldBeEqualIgnoringWhitespace(actual, expected));
+    verify(failures).failure(info, shouldBeEqualIgnoringWhitespace(actual, expected), actual, expected);
   }
 }
diff --git a/src/test/java/org/assertj/core/internal/strings/Strings_assertIsEqualToNormalizingNewlines_Test.java b/src/test/java/org/assertj/core/internal/strings/Strings_assertIsEqualToNormalizingNewlines_Test.java
--- a/src/test/java/org/assertj/core/internal/strings/Strings_assertIsEqualToNormalizingNewlines_Test.java
+++ b/src/test/java/org/assertj/core/internal/strings/Strings_assertIsEqualToNormalizingNewlines_Test.java
@@ -51,7 +51,7 @@ public void should_fail_if_newlines_are_different_in_both_strings() {
     try {
       strings.assertIsEqualToNormalizingNewlines(someInfo(), actual, expected);
     } catch (AssertionError e) {
-      verify(failures).failure(someInfo(), shouldBeEqualIgnoringNewLineDifferences(actual, expected));
+      verify(failures).failure(someInfo(), shouldBeEqualIgnoringNewLineDifferences(actual, expected), actual, expected);
       return;
     }
     failBecauseExpectedAssertionErrorWasNotThrown();
diff --git a/src/test/java/org/assertj/core/internal/strings/Strings_assertIsEqualsToIgnoringNewLines_Test.java b/src/test/java/org/assertj/core/internal/strings/Strings_assertIsEqualsToIgnoringNewLines_Test.java
--- a/src/test/java/org/assertj/core/internal/strings/Strings_assertIsEqualsToIgnoringNewLines_Test.java
+++ b/src/test/java/org/assertj/core/internal/strings/Strings_assertIsEqualsToIgnoringNewLines_Test.java
@@ -54,7 +54,7 @@ private void verifyThatAssertationErrorWasThrown(String actual, String expected)
     try {
       strings.assertIsEqualToIgnoringNewLines(someInfo(), actual, expected);
     } catch (AssertionError e) {
-      verify(failures).failure(someInfo(), shouldBeEqualIgnoringNewLines(actual, expected));
+      verify(failures).failure(someInfo(), shouldBeEqualIgnoringNewLines(actual, expected), actual, expected);
       return;
     }
     failBecauseExpectedAssertionErrorWasNotThrown();