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

Migrating from easymock 2.X to 5.x .org.easymock.MockControl is not found #451

Open
bishtjagmohan opened this issue Aug 1, 2023 · 5 comments

Comments

@bishtjagmohan
Copy link

We have codes using org.easymock.MockControl but it's gone from 3.x onwards. What's the replacement for this?

@henri-tremblay
Copy link
Contributor

What is the code?

@bishtjagmohan
Copy link
Author

MockControl.createControl( clazz ) , control.verify() and many others. I see that it's stated to use EasyMock's static methods instead of these . But looking for like to like replacement for minimal change.

@henri-tremblay
Copy link
Contributor

I don't think there ever was a MockControl.createControl. It would be more new MocksControl(). But yes, the replacement is EasyMock.createControl()

@bishtjagmohan
Copy link
Author

bishtjagmohan commented Aug 2, 2023

Can we have this switch:
setDefaultReturnValue(Object value) > EasyMock.expectLastCall().andStubReturn(value);

MockControl.createControl(Class toMock) >EasyMock.createNiceMock()

@henri-tremblay
Copy link
Contributor

No. They were removed since they felt not that useful.
I am waiting for someone to demonstrate a useful use case to add them back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants