Git Product home page Git Product logo

intellij-templates's Introduction

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

intellij-templates's People

Contributors

dwursteisen avatar rossh avatar timomeinen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

intellij-templates's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.