#IntelliJ 13 code templates
##How to install the template
mvn clean package
- Then, launch Intellij.
- File > Import Settings...
- Load the file settings.jar of the target project
##For to use this template
Ctrl+J them type "that" to get assertThat method from fest-assert (with static import,...)
or for surround templates : select a block of code then : Ctrl + Alt + J and type TRY to surround your code with a try {} catch {}
##IntelliJ templates folder:
On Windows
- file://~/.IntelliJIdea13/config/templates
##References
- Quelques live template intellij pour Mockito
- IntelliJ Live templates documentation
- https://code.google.com/p/mockito/
##Code templates
template | description |
---|---|
doThrow | mockito / doThrow ... when |
when | mockito when / thenReturn |
doReturn | mockito / doReturn...when |
gw | BDD Stub mock with given(…).willReturn(…) style |
wg | BDD Stub spy/mock with willReturn(…).given(…) style |
am | Creates a field with the @Mock annotation |
as | Creates a field with the @Spy annotation |
aim | Creates a field with the @InjectMocks annotation |
rwm | Add @RunWith(MockitoJUnitRunner.class) |
verif | Inserts a verify(…) statement |
ioverif | Inserts Mockito.inOrder(mocks) followed by inOrder.verify(…) statementInserts Mockito.inOrder(mocks) followed by inOrder.verify(…) statement |
template | description |
---|---|
that | that / assert4j |
equalto | Fest Assertion assertThat / is equal to |
template | description |
---|---|
should_NG | create a test NG unit test |
template | description |
---|---|
should | create a junit test |
run_theories | Run With Theories |
should_theory | create theory unit test |
template | description |
---|---|
TRY | Surround with Try/Catch |