forked from playframework/play-java-starter-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunctionalTest.java
More file actions
24 lines (20 loc) · 814 Bytes
/
FunctionalTest.java
File metadata and controls
24 lines (20 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import org.junit.Test;
import play.test.WithApplication;
import play.twirl.api.Content;
import static org.assertj.core.api.Assertions.assertThat;
/**
* A functional test starts a Play application for every test.
*
* https://www.playframework.com/documentation/latest/JavaFunctionalTest
*/
public class FunctionalTest extends WithApplication {
@Test
public void renderTemplate() {
// If you are calling out to Assets, then you must instantiate an application
// because it makes use of assets metadata that is configured from
// the application.
Content html = views.html.index.render("Your new application is ready.");
assertThat("text/html").isEqualTo(html.contentType());
assertThat(html.body()).contains("Your new application is ready.");
}
}