Skip to content

Instantly share code, notes, and snippets.

View nlativy's full-sized avatar

Nicholas Lativy nlativy

View GitHub Profile
@nlativy
nlativy / GuiceRule.java
Last active August 29, 2015 14:10
GuiceRule - rule for using Guice in JUnit4 tests
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.inject.Guice;
import com.google.inject.Module;
import org.junit.rules.MethodRule;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.Statement;
public class GuiceRule implements MethodRule {
private final Module module;