-
-
Notifications
You must be signed in to change notification settings - Fork 314
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
[EasyMock 3.5] Reporting when mock fails #219
Comments
I'm not sure I get what you are asking? In case of an unexpected call, you would like to see all the currently expected calls in the error message? |
Yes. :)
…On Sat, Jun 30, 2018 at 5:32 AM Henri Tremblay ***@***.***> wrote:
I'm not sure I get what you are asking? In case of an unexpected call, you
would like to see all the currently expected calls in the error message?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#219 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAu397V_XPCg0AtJXvO_kYiC_YZtFvKqks5uBvFngaJpZM4U65x8>
.
--
Best regards / Med venlig hilsen
Nino Martinez
|
in short yes.:) |
Yes, that would be a really nice feature |
It's probably possible. However, the EasyMock development bandwidth is quite limited these days. So I don't know when it will come out. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi
This could be an improvement or possible an existing feature? We've searched up and down, but only found one way to do this..
When a mock fails this is output:
java.lang.AssertionError:
Unexpected method call readOnlyAllInOneService.getPrompts("159159", "PERSONAL_ADVISER", "INITIALIZING"):
readOnlyAllInOneService.getKeySetup("159159", "PERSONAL_ADVISER"): expected: 1, actual: 1
CallData.getKeyEntered(): expected: 1, actual: 0
We would like more information like this
java.lang.AssertionError:
Unexpected method call readOnlyAllInOneService.getPrompts("159159", "PERSONAL_ADVISER", "INITIALIZING"):
readOnlyAllInOneService.getFlowSettingFromParameterName("159159", "ano", "size"): expected: 1, actual: 1
readOnlyAllInOneService.getKeySetup("159159", "LOGINUSER"): expected: 1, actual: 1
CallData.getKeyEntered(): expected: 1, actual: 1
readOnlyAllInOneService.getFlowSetting("159159", "promptURL"): expected: 1, actual: 1
readOnlyAllInOneService.getKeySetup("159159", "LOGINUSER"): expected: 1, actual: 1
CallData.getKeyEntered(): expected: 1, actual: 1
readOnlyAllInOneService.getPromptsForRetry("159159", "LOGINUSER", "TERMINATOR", 2 (int)): expected: 1, actual: 1
CallData.getKeyEntered(): expected: 1, actual: 1
readOnlyAllInOneService.getPrompts("159159", "LOGINUSER", "Valid"): expected: 1, actual: 1
readOnlyAllInOneService.getKeySetup("159159", "LOGINCODE"): expected: 1, actual: 1
CallData.getKeyEntered(): expected: 1, actual: 1
readOnlyAllInOneService.getPromptsForRetry("159159", "LOGINCODE", "TERMINATOR", 1 (int)): expected: 1, actual: 1
CallData.getKeyEntered(): expected: 1, actual: 1
readOnlyAllInOneService.getPromptsForRetry("159159", "LOGINCODE", "TERMINATOR", 2 (int)): expected: 1, actual: 1
readOnlyAllInOneService.getKeySetup("159159", "LOGINCODE"): expected: 1, actual: 1
CallData.getKeyEntered(): expected: 1, actual: 1
mqConnection.request(matches(".T020."), 566 (int)): expected: 1, actual: 1
readOnlyAllInOneService.getPrompts("159159", "*", "ReturCode050ReasonCode014"): expected: 1, actual: 1
readOnlyAllInOneService.getKeySetup("159159", "LOGINUSER"): expected: 1, actual: 1
CallData.getKeyEntered(): expected: 1, actual: 1
readOnlyAllInOneService.getPrompts("159159", "PERSONAL_ADVISER", "Valid"): expected: 1, actual: 0
readOnlyAllInOneService.getPrompts("159159", "PERSONAL_ADVISER", "transfer"): expected: 1, actual: 0
readOnlyAllInOneService.getPrompts("159159", "PERSONAL_ADVISER", "transfer_NOT_LOGIN"): expected: 1, actual: 0
readOnlyAllInOneService.getFlowSettingFromParameterName("159159", "PERSONAL_ADVISER", "defaultTransferNumber"): expected: 1, actual: 0
readOnlyAllInOneService.getFlowSettingFromParameterName("159159", "PERSONAL_ADVISER", "DefaultGroup"): expected: 1, actual: 0
Only way we found todo this are like so
Set break point in class org.easymock.internal.MocksBehavior
https://github.com/easymock/easymock/blob/master/core/src/main/java/org/easymock/internal/MocksBehavior.java#L132
Method
public final Result addActual(Invocation actual) {
this line (132)
for (int i = initialPosition; i <= endPosition; i++) {
Change to initialPosition = 0
Cange to endPosition = behaviorLists.size()-1
Are there any way to setup reporting for easy mock todo so?
A nice way would be to be able to output something like this (No idea of the implementation it requires) Where all mocks would be listed for each test
The text was updated successfully, but these errors were encountered: