Skip to content

Instantly share code, notes, and snippets.

@Jimexist
Last active April 18, 2016 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jimexist/e7dc07bd7ae78c5665ddbb75e359cacd to your computer and use it in GitHub Desktop.
Save Jimexist/e7dc07bd7ae78c5665ddbb75e359cacd to your computer and use it in GitHub Desktop.
Writing better test code

Test early, test often, test automatically

  • The pragmatic programmer.

When you use IntelliJ Idea, and say you have such class:

public class TurbineServer extends Application<TurbineConfiguration> {

}

and when you click on TurbineServer and press command + shift + T you can switch between class and its unit test.

Also you can create new test, @Before, and @After by pressing command + N.

You can use Mockito to help you do mocking. Checkout the example at their website.

You can use FixtureHelper class to load your fixture file as a String for testing purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment