Skip to content

Instantly share code, notes, and snippets.

@DarylWM
Created November 29, 2013 04:14
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 DarylWM/7701502 to your computer and use it in GitHub Desktop.
Save DarylWM/7701502 to your computer and use it in GitHub Desktop.
import com.google.inject.AbstractModule;
import com.google.inject.name.Names;
import play.test.TestBrowser;
import play.test.TestServer;
import static play.test.Helpers.*;
public class CucumberModule extends AbstractModule {
private static int PORT = 3333;
private TestServer testServer = testServer(PORT, fakeApplication(inMemoryDatabase()));
private TestBrowser testBrowser = testBrowser(HTMLUNIT, PORT);
@Override
protected void configure() {
bind(TestBrowser.class).toInstance(testBrowser);
bind(TestServer.class).toInstance(testServer);
bind(Integer.class).annotatedWith(Names.named("PORT")).toInstance(PORT);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment