Wednesday, March 28, 2012

Create a custom Eclipse Template @RunWith(MockitoJUnitRunner.class)

I got sick of typing out the @RunWith for mockito support on my test cases so I created a template to autocomplete it for me. And yes you can make a template for anything you want.

First go to Java -> Editor -> Templates



Click on New then enter this into the text box:
${:import(org.mockito.runners.MockitoJUnitRunner, org.junit.runner.RunWith)} @RunWith(MockitoJUnitRunner.class)

And here are some more awesomely useful templates.

No comments:

Post a Comment