Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes error message less misleading and points to github for help. Issue #2692 #2693

Merged
merged 2 commits into from Jun 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -219,14 +219,14 @@ private Object readResolve() throws ObjectStreamException {
+ typeToMock.getCanonicalName()
+ "'. The error was :",
" " + ioe.getMessage(),
"If you are unsure what is the reason of this exception, feel free to contact us on the mailing list."),
"If you are unsure what is the reason of this exception, feel free to open an issue on GitHub."),
ioe);
} catch (ClassNotFoundException cce) {
throw new MockitoSerializationIssue(
join(
"A class couldn't be found while deserializing a Mockito mock, you should check your classpath. The error was :",
" " + cce.getMessage(),
"If you are still unsure what is the reason of this exception, feel free to contact us on the mailing list."),
"If you are still unsure what is the reason of this exception, feel free to open an issue on GitHub."),
cce);
}
}
Expand Down
Expand Up @@ -434,7 +434,7 @@ private <T> RuntimeException prettifyFailure(
join(
"Mockito cannot mock this class: " + mockFeatures.getTypeToMock() + ".",
"",
"If you're not sure why you're getting this error, please report to the mailing list.",
"If you're not sure why you're getting this error, please open an issue on GitHub.",
"",
Platform.warnForVM(
"IBM J9 VM",
Expand Down
Expand Up @@ -114,8 +114,9 @@ private <T> RuntimeException prettifyFailure(
join(
"Mockito cannot mock this class: " + mockFeatures.getTypeToMock() + ".",
"",
"Mockito can only mock non-private & non-final classes.",
"If you're not sure why you're getting this error, please report to the mailing list.",
"Mockito can only mock non-private & non-final classes, but the root cause of this error might be different.",
"Please check the full stacktrace to understand what the issue is.",
"If you're still not sure why you're getting this error, please open an issue on GitHub.",
"",
Platform.warnForVM(
"IBM J9 VM",
Expand Down
Expand Up @@ -93,7 +93,7 @@ public InternalRunner create(Class<?> klass, Supplier<MockitoTestListener> liste
+ "MockitoRunner can only be used with JUnit 4.5 or higher.\n"
+ "You can upgrade your JUnit version or write your own Runner (please consider contributing your runner to the Mockito community).\n"
+ "Bear in mind that you can still enjoy all features of the framework without using runners (they are completely optional).\n"
+ "If you get this error despite using JUnit 4.5 or higher then please report this error to the mockito mailing list.\n",
+ "If you get this error despite using JUnit 4.5 or higher, then please open an issue on GitHub.\n",
t);
}
}
Expand Down