Skip to content

Instantly share code, notes, and snippets.

@lifeofreilly
Created January 1, 2015 21:56
Show Gist options
  • Save lifeofreilly/a6cc3e854116248e0fc8 to your computer and use it in GitHub Desktop.
Save lifeofreilly/a6cc3e854116248e0fc8 to your computer and use it in GitHub Desktop.
JUnit Test Template
package com.gmail.lifeofreilly.myproject;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestRule;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
import static org.junit.Assert.assertEquals;
public class MyTest {
@Rule
public TestRule watcher = new TestWatcher() {
protected void starting(Description description) {
System.out.println("Starting test: " + description.getMethodName());
}
};
@Test
public void myTest() throws Exception {
assertEquals(true, true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment