Skip to content

Instantly share code, notes, and snippets.

@chkal
Created July 3, 2017 14:03
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 chkal/69e32a8b5ae423b983cdd545594ee408 to your computer and use it in GitHub Desktop.
Save chkal/69e32a8b5ae423b983cdd545594ee408 to your computer and use it in GitHub Desktop.
MVC TCK
@Controller
@Path("/simple")
public class SimpleController {
@GET
public String get() {
return "simple.jsp";
}
}
@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