Skip to content

Instantly share code, notes, and snippets.

@davidpdrsn
Last active December 30, 2015 07:19
Show Gist options
  • Save davidpdrsn/7795040 to your computer and use it in GitHub Desktop.
Save davidpdrsn/7795040 to your computer and use it in GitHub Desktop.
A template for JUnit files.
import java.util.*;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import org.junit.Test; // for @Test
import org.junit.Before; // for @Before
import org.junit.Ignore; // for @Ignore
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class FooTest {
@Test
public void testAssertEquals() {
int x = 3;
assertThat(x, is(3));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment