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

What is the recommended way of mocking? #80

Closed
ColinHebert opened this issue Sep 28, 2014 · 1 comment
Closed

What is the recommended way of mocking? #80

ColinHebert opened this issue Sep 28, 2014 · 1 comment
Assignees
Labels

Comments

@ColinHebert
Copy link

@ColinHebert ColinHebert commented Sep 28, 2014

There are many different ways of using mocks with jmockit. Depending on the context one way would be preferable to another.
What are the different use cases?

I personally tend to use @Injectable a lot because it gives more control over what is mocked and allow multiple mocks of the same class with different behaviours. The only few times I rely on @Mocked are for static mocking and interaction with the constructor (and I rely on those as little as possible).

Is it how jmockit is intended to be used?

@rliesenfeld

This comment has been minimized.

Copy link
Member

@rliesenfeld rliesenfeld commented Sep 29, 2014

The Tutorial (https://jmockit.github.io/tutorial.html) should describe the different use cases.

@rliesenfeld rliesenfeld reopened this Sep 30, 2014
@rliesenfeld rliesenfeld added enhancement and removed question labels Oct 2, 2014
@rliesenfeld rliesenfeld self-assigned this Oct 2, 2014
@jmockit jmockit deleted a comment from ColinHebert Aug 23, 2017
@jmockit jmockit deleted a comment from ColinHebert Aug 23, 2017
@jmockit jmockit deleted a comment from weicheng113 Aug 23, 2017
@jmockit jmockit deleted a comment from weicheng113 Aug 23, 2017
@jmockit jmockit deleted a comment from weicheng113 Aug 23, 2017
@jmockit jmockit deleted a comment from weicheng113 Aug 23, 2017
@jmockit jmockit locked and limited conversation to collaborators Aug 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.