What is the recommended way of mocking? #80

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

Comments

2 participants
@ColinHebert

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.

Show comment
Hide comment
@rliesenfeld

rliesenfeld Sep 29, 2014

Member

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

Member

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.