All Projects → dwursteisen → intellij-templates

dwursteisen / intellij-templates

Licence: other
No description, website, or topics provided.

Programming Languages

ruby
36898 projects - #4 most used programming language

IntelliJ 13 code templates

Sample

Ctrl+J them type "that" to get assertThat method from assertj (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 {}

How to get it ?

  • Download intellij-templates.zip (which is this repo, but in a zip file)
  • In IntelliJ : click on File > Import Settings
  • Select the zip you have just downloaded
  • Import Live Templates & answer Yes when IntelliJ wants to be restarted
  • Enjoy !

Lives Templates

References

Code templates

Mockito

template description
doThrowmockito / doThrow ... when
doReturnmockito / doReturn...when
gwBDD Stub mock with given(…).willReturn(…) style
wgBDD Stub spy/mock with willReturn(…).given(…) style
amCreates a field with the @Mock annotation
asCreates a field with the @Spy annotation
aimCreates a field with the @InjectMocks annotation
rwmAdd @RunWith(MockitoJUnitRunner.class)
verifInserts a verify(…) statement
ioverifInserts Mockito.inOrder(mocks) followed by inOrder.verify(…) statementInserts Mockito.inOrder(mocks) followed by inOrder.verify(…) statement

Assertj

template description
thatthat / fest assert
extextract property
filterfilter property

jUnit

template description
bfCreates a setup method
shouldcreate a junit test
run_theoriesRun With Theories
should_theorycreate theory unit test
swatCreates a junit test with assert that

testNG

template description
should_NGcreate a test NG unit test

plain java (surround)

template description
TRYSurround with Try/Catch
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].