Created
October 8, 2012 10:27
-
-
Save nekman/3851854 to your computer and use it in GitHub Desktop.
JUnit code template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package ${enclosing_package}; | |
| /** | |
| * Eclipse JUnit template that imports | |
| * Mockito + common asserts and matchers. | |
| * | |
| * Import by select: Window > Preferences > Java > Editor > Templates > New... | |
| * | |
| */ | |
| import static junit.framework.Assert.*; | |
| import static org.hamcrest.CoreMatchers.*; | |
| import static org.hamcrest.core.Is.is; | |
| import static org.hamcrest.core.IsNot.*; | |
| import static org.junit.Assert.*; | |
| import static org.mockito.Mockito.*; | |
| import static org.mockito.Matchers.*; | |
| import org.junit.*; | |
| import org.junit.After; | |
| import org.junit.Before; | |
| import org.junit.Test; | |
| public class ${enclosing_type} { | |
| @Before | |
| public void setup() { | |
| //TODO: | |
| } | |
| @After | |
| public void tearDown() { | |
| //TODO: | |
| } | |
| @Test | |
| public void shouldDoDummyStuff() { | |
| ${cursor} | |
| //TODO: | |
| final Object o = mock(Object.class); | |
| assertThat(o, is(notNullValue())); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment