Created
August 9, 2015 20:53
-
-
Save heat/6138b01707152eb74df7 to your computer and use it in GitHub Desktop.
This file contains 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
import org.junit.*; | |
import play.libs.ws.WS; | |
import play.libs.ws.WSResponse; | |
import play.mvc.*; | |
import play.test.*; | |
import play.libs.F.*; | |
import static play.test.Helpers.*; | |
import static org.junit.Assert.*; | |
import static org.hamcrest.CoreMatchers.*; | |
import static org.fluentlenium.core.filter.FilterConstructor.*; | |
public class IntegrationTest extends WithApplication { | |
/** | |
* add your integration test here | |
* in this example we just check if the welcome page is being shown | |
*/ | |
@Test | |
public void test() { | |
running(testServer(3333, fakeApplication(inMemoryDatabase())), HTMLUNIT, new Callback<TestBrowser>() { | |
public void invoke(TestBrowser browser) { | |
browser.goTo("http://localhost:3333"); | |
assertThat(browser.pageSource(), containsString("Add Person")); | |
} | |
}); | |
} | |
@Test | |
public void testRequest() { | |
Promise<WSResponse> promise = WS.url("http://www.google.com").get(); | |
assertThat( | |
promise.get(1000).getStatus(), equalTo(OK)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment