You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!this.expectedException.getClass().isAssignableFrom(item.getClass())) {
30
+
mismatchDescription.appendValue(item.getClass().getName()).appendText(" instead of a ").appendValue(this.expectedException.getClass().getName()).appendText(" exception");
31
+
returnfalse;
32
+
}
33
+
if (!item.getMessage().equals(this.expectedException.getMessage())) {
34
+
mismatchDescription.appendValue(item.getClass().getName()).appendText(" with message ").appendValue(item.getMessage()).appendText(" instead of ").appendValue(this.expectedException.getMessage());
35
+
returnfalse;
36
+
}
37
+
38
+
returntrue;
30
39
}
31
40
32
41
@Override
33
42
publicvoiddescribeTo(Descriptiondescription) {
34
43
description.appendValue(expectedException.getClass().getName()).appendText(" with message ").appendValue(expectedException.getMessage());
if (this.expectedException.getClass().isAssignableFrom(item.getClass())) {
40
-
mismatchDescription.appendValue(item.getClass().getName()).appendText(" with message ").appendValue(item.getMessage()).appendText(" instead of ").appendValue(this.expectedException.getMessage());
41
-
return;
42
-
}
43
-
mismatchDescription.appendValue(item.getClass().getName()).appendText(" instead of a ").appendValue(this.expectedException.getClass().getName()).appendText(" exception");
if (!this.messageMatcher.matches(item.getMessage())) {
37
+
mismatchDescription.appendText("an exception with message ").appendValue(item.getMessage()).appendText(" instead of ").appendDescriptionOf(messageMatcher);
38
+
returnfalse;
39
+
}
40
+
41
+
returntrue;
37
42
}
38
43
39
44
@Override
40
45
publicvoiddescribeTo(Descriptiondescription) {
41
46
description.appendText("an exception with message ").appendDescriptionOf(messageMatcher);
mismatchDescription.appendText("an exception with message ").appendValue(item.getMessage()).appendText(" instead of ").appendDescriptionOf(messageMatcher);
0 commit comments