Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upWhat is the recommended way of mocking? #80
Closed
Labels
Comments
This comment has been minimized.
This comment has been minimized.
The Tutorial (https://jmockit.github.io/tutorial.html) should describe the different use cases. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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?