Created
July 3, 2017 14:03
-
-
Save chkal/69e32a8b5ae423b983cdd545594ee408 to your computer and use it in GitHub Desktop.
MVC TCK
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
@Controller | |
@Path("/simple") | |
public class SimpleController { | |
@GET | |
public String get() { | |
return "simple.jsp"; | |
} | |
} |
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
@RunWith(Arquillian.class) | |
public class SimpleTest { | |
@ArquillianResource | |
private URL baseUrl; | |
@Deployment(testable = false) | |
public static WebArchive createDeployment() { | |
return Archives.getMvcArchive() | |
.addClass(SimpleController.class) | |
.addView("<h1>Hello world!</h1>", "simple.jsp") | |
.build(); | |
} | |
@Test | |
public void shouldDoStuff() throws IOException { | |
Page page = new WebClient() | |
.getPage(baseUrl.toString() + "mvc/simple"); | |
Assert.assertThat( | |
page.getWebResponse().getContentAsString(), | |
CoreMatchers.containsString("Hello world!") | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment