To use Mockwire with Junit

I primarily use Junit because I use Infinitest and Junit support in eclipse is a tad better than Testng.

@RunWith(MockwireRunner.class)
public class UnitTest {

 

Blessing and Mocking

@Bless and @Mock and mock are used to define the types that end up in the wire test environment.

@Bless
SomeConcreteClass codeToTest;

And controlled dependencies of the code to test, e.g. SomeConcreteClass requires a SomeInterface, this requirement is defined by @Inject

@Mock
SomeInterface thatSomeConcreteClassNeeds;