Examples of MvcResult


Examples of org.springframework.test.web.servlet.MvcResult

    @Test
    public void givenManyPosts_blogIndexShowsPaginationControl() throws Exception {
        createManyPostsInNovember(21);

        MvcResult response = mockMvc.perform(get("/blog?page=2")).andReturn();

        Document html = Jsoup.parse(response.getResponse().getContentAsString());

        Element previousLink = html.select("#pagination_control a.previous").first();
        assertThat("No previous pagination link found", previousLink, is(notNullValue()));
        String previousHref = previousLink.attributes().get("href");
        assertThat(previousHref, is("/blog?page=1"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.