Skip to content

Commit faa6dd0

Browse files
committed
Remove <> from ShouldNotEndWith, ShouldNotExist, ShouldNotHave, ShouldNotHaveAnyElementsOfTypes, ShouldNotHaveDuplicates, ShouldNotHaveSameClass, ShouldNotHaveSameHashCode and ShouldNotHaveThrown
See assertj#2091
1 parent e30e6d3 commit faa6dd0

16 files changed

+29
-29
lines changed

src/main/java/org/assertj/core/error/ShouldNotEndWith.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ public static ErrorMessageFactory shouldNotEndWith(Object actual, Object expecte
4848
}
4949

5050
private ShouldNotEndWith(Object actual, Object expected, ComparisonStrategy comparisonStrategy) {
51-
super("%nExpecting:%n <%s>%nnot to end with:%n <%s>%n%s", actual, expected, comparisonStrategy);
51+
super("%nExpecting:%n %s%nnot to end with:%n %s%n%s", actual, expected, comparisonStrategy);
5252
}
5353
}

src/main/java/org/assertj/core/error/ShouldNotExist.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
public class ShouldNotExist extends BasicErrorMessageFactory {
2828

2929
@VisibleForTesting
30-
public static final String PATH_SHOULD_NOT_EXIST = "%nExpecting path:%n <%s>%nnot to exist";
30+
public static final String PATH_SHOULD_NOT_EXIST = "%nExpecting path:%n %s%nnot to exist";
3131
@VisibleForTesting
32-
public static final String FILE_SHOULD_NOT_EXIST = "%nExpecting file:%n <%s>%nnot to exist";
32+
public static final String FILE_SHOULD_NOT_EXIST = "%nExpecting file:%n %s%nnot to exist";
3333

3434
/**
3535
* Creates a new <code>{@link ShouldNotExist}</code>.

src/main/java/org/assertj/core/error/ShouldNotHave.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ public static <T> ErrorMessageFactory shouldNotHave(T actual, Condition<? super
3535
}
3636

3737
private ShouldNotHave(Object actual, Condition<?> condition) {
38-
super("%nExpecting:%n <%s>%nnot to have:%n <%s>", actual, condition);
38+
super("%nExpecting:%n %s%nnot to have:%n %s", actual, condition);
3939
}
4040
}

src/main/java/org/assertj/core/error/ShouldNotHaveAnyElementsOfTypes.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ private ShouldNotHaveAnyElementsOfTypes(Object actual, Class<?>[] unexpectedType
2121
Map<Class<?>, List<Object>> nonMatchingElementsByType) {
2222
super("%n" +
2323
"Expecting:%n" +
24-
" <%s>%n" +
24+
" %s%n" +
2525
"to not have any elements of the following types:%n" +
26-
" <%s>%n" +
26+
" %s%n" +
2727
"but found:%n" +
28-
" <%s>",
28+
" %s",
2929
actual, unexpectedTypes, nonMatchingElementsByType);
3030
}
3131

src/main/java/org/assertj/core/error/ShouldNotHaveDuplicates.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static ErrorMessageFactory shouldNotHaveDuplicates(Object actual, Object
4646
}
4747

4848
private ShouldNotHaveDuplicates(Object actual, Object duplicates, ComparisonStrategy comparisonStrategy) {
49-
super("%nFound duplicate(s):%n <%s>%nin:%n <%s>%n%s", duplicates, actual, comparisonStrategy);
49+
super("%nFound duplicate(s):%n %s%nin:%n %s%n%s", duplicates, actual, comparisonStrategy);
5050
}
5151

5252
}

src/main/java/org/assertj/core/error/ShouldNotHaveSameClass.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ public static ErrorMessageFactory shouldNotHaveSameClass(Object actual, Object o
3030
}
3131

3232
private ShouldNotHaveSameClass(Object actual, Object other) {
33-
super("%nExpecting:%n <%s>%nnot to have the same class as:%n <%s> (%s)", actual, other, actual.getClass());
33+
super("%nExpecting:%n %s%nnot to have the same class as:%n %s (%s)", actual, other, actual.getClass());
3434
}
3535
}

src/main/java/org/assertj/core/error/ShouldNotHaveSameHashCode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ public static ErrorMessageFactory shouldNotHaveSameHashCode(Object actual, Objec
2020

2121
private ShouldNotHaveSameHashCode(Object actual, Object other) {
2222
super("%nExpecting%n" +
23-
" <%s>%n" +
23+
" %s%n" +
2424
"not to have the same hash code as:%n" +
25-
" <%s>%n" +
25+
" %s%n" +
2626
"hash code is%n" +
27-
" <%s>",
27+
" %s",
2828
actual, other, actual.hashCode());
2929
}
3030
}

src/main/java/org/assertj/core/error/ShouldNotHaveThrown.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ public static ErrorMessageFactory shouldNotHaveThrown(Throwable throwable) {
2121
}
2222

2323
private ShouldNotHaveThrown(Throwable throwable) {
24-
super("%nExpecting code not to raise a throwable but caught%n <%s>", getStackTrace(throwable));
24+
super("%nExpecting code not to raise a throwable but caught%n %s", getStackTrace(throwable));
2525
}
2626
}

src/test/java/org/assertj/core/api/throwable/NotThrownAssert_description_Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void should_contain_provided_description_if_exception_is_thrown_by_lambda(Functi
5858
then(assertionError).hasMessageStartingWith(format("[test description] %n" +
5959
"Expecting code not to raise a throwable but caught%n"
6060
+
61-
" <\"java.lang.IllegalArgumentException"));
61+
" \"java.lang.IllegalArgumentException"));
6262
}
6363

6464
}

src/test/java/org/assertj/core/error/ShouldNotEndWith_create_Test.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ void should_create_error_message() {
4141
// THEN
4242
then(message).isEqualTo(format("[Test] %n" +
4343
"Expecting:%n" +
44-
" <[\"Yoda\", \"Luke\"]>%n" +
44+
" [\"Yoda\", \"Luke\"]%n" +
4545
"not to end with:%n" +
46-
" <[\"Han\", \"Leia\"]>%n"));
46+
" [\"Han\", \"Leia\"]%n"));
4747
}
4848

4949
@Test
@@ -56,9 +56,9 @@ void should_create_error_message_with_custom_comparison_strategy() {
5656
// THEN
5757
then(message).isEqualTo(format("[Test] %n" +
5858
"Expecting:%n" +
59-
" <[\"Yoda\", \"Luke\"]>%n" +
59+
" [\"Yoda\", \"Luke\"]%n" +
6060
"not to end with:%n" +
61-
" <[\"Han\", \"Leia\"]>%n" +
61+
" [\"Han\", \"Leia\"]%n" +
6262
"when comparing values using CaseInsensitiveStringComparator"));
6363
}
6464
}

0 commit comments

Comments
 (0)