Useful Eclipse Java Editor Templates: EasyMock
EasyMock is a really useful tool for unit testing. If you want to test a class which is usually contained in a web of collaboration with other classes, you can easily simulate the other classes’ behaviour using a rather simple and powerful mocking mechanism.
And in order to save typing time, you can use this template to create your mock with one keystroke:
${staticImport:importStatic('org.easymock.EasyMock.*')}
${testType:newName} ${cursor} ${mock:newName} = createMock("${mock}", ${testType}.class);
And, as usual, you can directly import the template using this XML.




