Skip to content

Commit 616cd7a

Browse files
committed
Remove <> from ShouldHaveLineCount, ShouldHaveMessage, ShouldHaveMessageFindingMatchRegex, ShouldHaveMessageMatchingRegex, ShouldHaveMethods, ShouldHaveName, ShouldHaveNoCause, ShouldHaveNoFields, ShouldHaveNoNullFields, ShouldHaveNoParent, ShouldHaveNoSuperclass, ShouldHaveOnlyElementsOfType and ShouldHavePackage
See assertj#2091
1 parent c6a458d commit 616cd7a

30 files changed

+108
-108
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ private ShouldHaveLineCount(Object actual, int actualSize, int expectedSize) {
3636
// format the sizes in a standard way, otherwise if we use (for ex) an Hexadecimal representation
3737
// it will format sizes in hexadecimal while we only want actual to be formatted in hexadecimal
3838
// Also don't indent actual first line since the remaining lines won't have any indentation
39-
super(format("%nExpecting text:%n%s%nto have <%s> lines but had <%s>.", "%s", expectedSize, actualSize), actual);
39+
super(format("%nExpecting text:%n%s%nto have %s lines but had %s.", "%s", expectedSize, actualSize), actual);
4040
}
4141
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public static ErrorMessageFactory shouldHaveMessage(Throwable actual, String exp
3434
private ShouldHaveMessage(Throwable actual, String expectedMessage) {
3535
super("%n" +
3636
"Expecting message to be:%n" +
37-
" <%s>%n" +
37+
" %s%n" +
3838
"but was:%n" +
39-
" <%s>%n" +
39+
" %s%n" +
4040
"%n" +
4141
"Throwable that failed the check:%n" +
4242
"%n" + escapePercent(getStackTrace(actual)), // to avoid AssertJ default String formatting

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ public static ErrorMessageFactory shouldHaveMessageFindingMatchRegex(Throwable a
3030
private ShouldHaveMessageFindingMatchRegex(Throwable actual, CharSequence regex) {
3131
super("%n" +
3232
"Expecting message:%n" +
33-
" <%s>%n" +
33+
" %s%n" +
3434
"to be found for regex:%n" +
35-
" <%s>%n" +
35+
" %s%n" +
3636
"but did not.%n" +
3737
"%n" +
3838
"Throwable that failed the check:%n" +

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ public static ErrorMessageFactory shouldHaveMessageMatchingRegex(Throwable actua
3030
private ShouldHaveMessageMatchingRegex(Throwable actual, CharSequence regex) {
3131
super("%n" +
3232
"Expecting message:%n" +
33-
" <%s>%n" +
33+
" %s%n" +
3434
"to match regex:%n" +
35-
" <%s>%n" +
35+
" %s%n" +
3636
"but did not.%n" +
3737
"%n" +
3838
"Throwable that failed the check:%n" +

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,31 +53,31 @@ public static ErrorMessageFactory shouldNotHaveMethods(Class<?> actual, boolean
5353
private ShouldHaveMethods(Class<?> actual, Set<String> expected, Set<String> missing, boolean declared) {
5454
super("%n" +
5555
"Expecting%n" +
56-
" <%s>%n" +
56+
" %s%n" +
5757
"to have " + (declared ? "declared " : "") + "methods:%n" +
58-
" <%s>%n" +
58+
" %s%n" +
5959
"but could not find:%n" +
60-
" <%s>", actual, expected, missing);
60+
" %s", actual, expected, missing);
6161
}
6262

6363
private ShouldHaveMethods(Class<?> actual, Set<String> expected, String modifier, Map<String, String> nonMatching,
6464
boolean declared) {
6565
super("%n" +
6666
"Expecting%n" +
67-
" <%s>%n" +
67+
" %s%n" +
6868
"to have " + (declared ? "declared " : "") + modifier + " " + "methods:%n" +
69-
" <%s>%n" +
69+
" %s%n" +
7070
"but the following are not " + modifier + ":%n" +
71-
" <%s>", actual, expected, nonMatching);
71+
" %s", actual, expected, nonMatching);
7272
}
7373

7474
private ShouldHaveMethods(Class<?> actual, String modifier, boolean declared,
7575
Set<String> actualMethodsHavingModifier) {
7676
super("%n" +
7777
"Expecting%n" +
78-
" <%s>%n" +
78+
" %s%n" +
7979
"not to have any " + (declared ? "declared " : "")
8080
+ (modifier != null && modifier.length() > 0 ? modifier + " " : "") + "methods but it has the following:%n" +
81-
" <%s>", actual, actualMethodsHavingModifier);
81+
" %s", actual, actualMethodsHavingModifier);
8282
}
8383
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
public class ShouldHaveName extends BasicErrorMessageFactory {
2424

25-
private static final String SHOULD_HAVE_NAME = "%nExpecting%n <%s>%nto have name:%n <%s>%nbut had:%n <%s>";
25+
private static final String SHOULD_HAVE_NAME = "%nExpecting%n %s%nto have name:%n %s%nbut had:%n %s";
2626

2727
public static ShouldHaveName shouldHaveName(File actual, String expectedName) {
2828
return new ShouldHaveName(actual, expectedName);
@@ -33,10 +33,10 @@ private ShouldHaveName(File actual, String expectedName) {
3333
}
3434

3535
public static ShouldHaveName shouldHaveName(Path actual, String expectedName) {
36-
return new ShouldHaveName(actual, expectedName);
36+
return new ShouldHaveName(actual, expectedName);
3737
}
3838

3939
private ShouldHaveName(Path actual, String expectedName) {
40-
super(SHOULD_HAVE_NAME, actual, expectedName, actual.getFileName());
40+
super(SHOULD_HAVE_NAME, actual, expectedName, actual.getFileName());
4141
}
4242
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ public static ErrorMessageFactory shouldHaveNoCause(Throwable actual) {
2929
}
3030

3131
private ShouldHaveNoCause(Throwable actual) {
32-
super("%nExpecting exception without cause, but cause was:<%s>", actual.getCause());
32+
super("%nExpecting exception without cause, but cause was: %s", actual.getCause());
3333
}
3434
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ public static ErrorMessageFactory shouldHaveNoDeclaredFields(Class<?> actual, Se
2626

2727
private ShouldHaveNoFields(Class<?> actual, Set<String> fields, boolean publik, boolean declared) {
2828
super("%nExpecting%n" +
29-
" <%s>%n" +
29+
" %s%n" +
3030
"not to have any " + fieldDescription(publik, declared) + " fields but it has:%n" +
31-
" <%s>", actual, fields);
31+
" %s", actual, fields);
3232
}
3333

3434
private static String fieldDescription(boolean publik, boolean declared) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
*/
2323
public class ShouldHaveNoNullFields extends BasicErrorMessageFactory {
2424

25-
private static final String EXPECTED_MULTIPLE = "%nExpecting%n <%s>%nto have a property or a field named <%s>.%n";
26-
private static final String EXPECTED_SINGLE = "%nExpecting%n <%s>%nnot to have any null property or field, but <%s> was null.%n";
25+
private static final String EXPECTED_MULTIPLE = "%nExpecting%n %s%nto have a property or a field named %s.%n";
26+
private static final String EXPECTED_SINGLE = "%nExpecting%n %s%nnot to have any null property or field, but %s was null.%n";
2727
private static final String COMPARISON = "Check was performed on all fields/properties";
28-
private static final String EXCLUDING = COMPARISON + " except: <%s>";
28+
private static final String EXCLUDING = COMPARISON + " except: %s";
2929
private static final String DOT = ".";
3030

3131
public ShouldHaveNoNullFields(Object actual, List<String> rejectedFields, List<String> ignoredFields) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
public class ShouldHaveNoParent extends BasicErrorMessageFactory {
2626

2727
@VisibleForTesting
28-
public static final String PATH_HAS_PARENT = "%nExpected actual path:%n <%s>%n not to have a parent, but parent was:%n <%s>";
28+
public static final String PATH_HAS_PARENT = "%nExpected actual path:%n %s%n not to have a parent, but parent was:%n %s";
2929

3030
@VisibleForTesting
31-
public static final String FILE_HAS_PARENT = "%nExpecting file (or directory):%n <%s>%nnot to have a parent, but parent was:%n <%s>";
31+
public static final String FILE_HAS_PARENT = "%nExpecting file (or directory):%n %s%nnot to have a parent, but parent was:%n %s";
3232

3333
/**
3434
* Creates a new <code>{@link ShouldHaveNoParent}</code>.

0 commit comments

Comments
 (0)