Skip to content

Commit 7bfdc93

Browse files
committed
Remove <> from ShouldNotBeIn, ShouldNotBeInstance, ShouldNotBeInstanceOfAny, ShouldNotBeOfClassIn and ShouldNotBeSame
See assertj#2091
1 parent 5fcbcbe commit 7bfdc93

12 files changed

+25
-25
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static ErrorMessageFactory shouldNotBeIn(Object actual, Object values) {
4545
}
4646

4747
private ShouldNotBeIn(Object actual, Object values, ComparisonStrategy comparisonStrategy) {
48-
super("%nExpecting:%n <%s>%nnot to be in:%n <%s>%n%s", actual, values, comparisonStrategy);
48+
super("%nExpecting:%n %s%nnot to be in:%n %s%n%s", actual, values, comparisonStrategy);
4949
}
5050

5151
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ public static ErrorMessageFactory shouldNotBeInstance(Object actual, Class<?> ty
3333
}
3434

3535
private ShouldNotBeInstance(Object actual, Class<?> type) {
36-
super("%nExpecting:%n <%s>%nnot to be an instance of:<%s>", actual, type);
36+
super("%nExpecting:%n %s%nnot to be an instance of: %s", actual, type);
3737
}
3838

3939
private ShouldNotBeInstance(Throwable throwable, Class<?> type) {
40-
super("%nExpecting:%n <%s>%nnot to be an instance of:<%s>", getStackTrace(throwable), type);
40+
super("%nExpecting:%n %s%nnot to be an instance of: %s", getStackTrace(throwable), type);
4141
}
4242
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public static ErrorMessageFactory shouldNotBeInstanceOfAny(Object actual, Class<
3434
}
3535

3636
private ShouldNotBeInstanceOfAny(Object actual, Class<?>[] types) {
37-
super("%nExpecting:%n <%s>%nnot to be an instance of any of these types:%n <%s>", actual, types);
37+
super("%nExpecting:%n %s%nnot to be an instance of any of these types:%n %s", actual, types);
3838
}
3939

4040
private ShouldNotBeInstanceOfAny(Throwable throwable, Class<?>[] types) {
41-
super("%nExpecting:%n <%s>%nnot to be an instance of any of these types:%n <%s>", getStackTrace(throwable), types);
41+
super("%nExpecting:%n %s%nnot to be an instance of any of these types:%n %s", getStackTrace(throwable), types);
4242
}
4343
}

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

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

3232
private ShouldNotBeOfClassIn(Object actual, Object types) {
33-
super("%nExpecting:%n <%s>%nnot to be of any type in:%n <%s>%nbut was of type:<%s>", actual, types, actual.getClass());
33+
super("%nExpecting:%n %s%nnot to be of any type in:%n %s%nbut was of type: %s", actual, types, actual.getClass());
3434
}
3535
}

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

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

3232
private ShouldNotBeSame(Object actual) {
33-
super("%nExpected not same:<%s>", actual);
33+
super("%nExpected not same: %s", actual);
3434
}
3535
}

src/test/java/org/assertj/core/api/offsettime/OffsetTimeAssert_isNotIn_Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ void test_isNotIn_assertion_error_message() {
4646
"03:03:03Z"))
4747
.withMessage(format("%n" +
4848
"Expecting:%n" +
49-
" <03:00:05Z>%n" +
49+
" 03:00:05Z%n" +
5050
"not to be in:%n" +
51-
" <[03:00:05Z, 03:03:03Z]>%n"));
51+
" [03:00:05Z, 03:03:03Z]%n"));
5252
}
5353

5454
@Test

src/test/java/org/assertj/core/api/zoneddatetime/ZonedDateTimeAssert_isNotIn_errors_Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ void test_isNotIn_assertion() {
4343
void test_isNotIn_assertion_error_message() {
4444
assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> assertThat(ZonedDateTime.of(2000, 1, 5, 3, 0, 5, 0,
4545
UTC)).isNotIn(ZonedDateTime.of(2000, 1, 5, 3, 0, 5, 0, UTC).toString(), ZonedDateTime.of(2012, 1, 1, 3, 3, 3, 0, UTC).toString()))
46-
.withMessage(format("%nExpecting:%n <2000-01-05T03:00:05Z (java.time.ZonedDateTime)>%nnot to be in:%n"
46+
.withMessage(format("%nExpecting:%n 2000-01-05T03:00:05Z (java.time.ZonedDateTime)%nnot to be in:%n"
4747
+
48-
" <[2000-01-05T03:00:05Z (java.time.ZonedDateTime),%n 2012-01-01T03:03:03Z (java.time.ZonedDateTime)]>%n"));
48+
" [2000-01-05T03:00:05Z (java.time.ZonedDateTime),%n 2012-01-01T03:03:03Z (java.time.ZonedDateTime)]%n"));
4949
}
5050

5151
@Test

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ void should_create_error_message() {
4242
// THEN
4343
then(message).isEqualTo(format("[Test] %n"
4444
+ "Expecting:%n"
45-
+ " <\"Luke\">%n"
45+
+ " \"Luke\"%n"
4646
+ "not to be in:%n"
47-
+ " <[\"Luke\", \"Leia\"]>%n"));
47+
+ " [\"Luke\", \"Leia\"]%n"));
4848
}
4949

5050
@Test
@@ -57,9 +57,9 @@ void should_create_error_message_with_custom_comparison_strategy() {
5757
// THEN
5858
then(message).isEqualTo(format("[Test] %n"
5959
+ "Expecting:%n"
60-
+ " <\"Luke\">%n"
60+
+ " \"Luke\"%n"
6161
+ "not to be in:%n"
62-
+ " <[\"Luke\", \"Leia\"]>%n"
62+
+ " [\"Luke\", \"Leia\"]%n"
6363
+ "when comparing values using CaseInsensitiveStringComparator"));
6464
}
6565
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ void should_create_error_message() {
3838
// THEN
3939
then(message).isEqualTo(format("[Test] %n" +
4040
"Expecting:%n" +
41-
" <\"Yoda\">%n" +
41+
" \"Yoda\"%n" +
4242
"not to be an instance of any of these types:%n" +
43-
" <[java.lang.String, java.lang.Object]>"));
43+
" [java.lang.String, java.lang.Object]"));
4444
}
4545

4646
@Test
@@ -52,8 +52,8 @@ void should_create_error_message_with_stack_trace_for_throwable() {
5252
String message = shouldNotBeInstanceOfAny(throwable, types).create();
5353
// THEN
5454
then(message).isEqualTo(format("%nExpecting:%n" +
55-
" <\"" + getStackTrace(throwable) + "\">%n" +
55+
" \"" + getStackTrace(throwable) + "\"%n" +
5656
"not to be an instance of any of these types:%n" +
57-
" <[java.lang.NullPointerException, java.lang.IllegalArgumentException]>"));
57+
" [java.lang.NullPointerException, java.lang.IllegalArgumentException]"));
5858
}
5959
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ void should_create_error_message() {
3737
// THEN
3838
then(message).isEqualTo(format("[Test] %n" +
3939
"Expecting:%n" +
40-
" <\"Yoda\">%n" +
41-
"not to be an instance of:<java.lang.String>"));
40+
" \"Yoda\"%n" +
41+
"not to be an instance of: java.lang.String"));
4242
}
4343

4444
@Test
@@ -49,7 +49,7 @@ void should_create_error_message_with_stack_trace_for_throwable() {
4949
String message = shouldNotBeInstance(throwable, IllegalArgumentException.class).create();
5050
// THEN
5151
then(message).isEqualTo(format("%nExpecting:%n" +
52-
" <\"" + getStackTrace(throwable) + "\">%n" +
53-
"not to be an instance of:<java.lang.IllegalArgumentException>"));
52+
" \"" + getStackTrace(throwable) + "\"%n" +
53+
"not to be an instance of: java.lang.IllegalArgumentException"));
5454
}
5555
}

0 commit comments

Comments
 (0)