Package org.springframework.test.web.servlet.request

Examples of org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder.param()


    @Test
    public void redirectToPublishedPostAfterCreation() throws Exception {
        MockHttpServletRequestBuilder createPostRequest = getCreatePostRequest();
        createPostRequest.param("title", "Post Title");
        createPostRequest.param("content", "My Content");
        createPostRequest.param("category", PostCategory.NEWS_AND_EVENTS.name());
        createPostRequest.param("draft", "false");
        createPostRequest.param("publishAt", "2013-07-01 13:15");

        mockMvc.perform(createPostRequest)
                .andExpect(status().isFound())
View Full Code Here


    public void redirectToPublishedPostAfterCreation() throws Exception {
        MockHttpServletRequestBuilder createPostRequest = getCreatePostRequest();
        createPostRequest.param("title", "Post Title");
        createPostRequest.param("content", "My Content");
        createPostRequest.param("category", PostCategory.NEWS_AND_EVENTS.name());
        createPostRequest.param("draft", "false");
        createPostRequest.param("publishAt", "2013-07-01 13:15");

        mockMvc.perform(createPostRequest)
                .andExpect(status().isFound())
                .andExpect(result -> {
View Full Code Here

        MockHttpServletRequestBuilder createPostRequest = getCreatePostRequest();
        createPostRequest.param("title", "Post Title");
        createPostRequest.param("content", "My Content");
        createPostRequest.param("category", PostCategory.NEWS_AND_EVENTS.name());
        createPostRequest.param("draft", "false");
        createPostRequest.param("publishAt", "2013-07-01 13:15");

        mockMvc.perform(createPostRequest)
                .andExpect(status().isFound())
                .andExpect(result -> {
                    String redirectedUrl = result.getResponse().getRedirectedUrl();
View Full Code Here

    }

    @Test
    public void createdPostValuesArePersisted() throws Exception {
        MockHttpServletRequestBuilder createPostRequest = getCreatePostRequest();
        createPostRequest.param("title", "Post Title");
        createPostRequest.param("content", "My Content");
        createPostRequest.param("category", PostCategory.ENGINEERING.name());
        createPostRequest.param("broadcast", "true");

        mockMvc.perform(createPostRequest);
View Full Code Here

    @Test
    public void createdPostValuesArePersisted() throws Exception {
        MockHttpServletRequestBuilder createPostRequest = getCreatePostRequest();
        createPostRequest.param("title", "Post Title");
        createPostRequest.param("content", "My Content");
        createPostRequest.param("category", PostCategory.ENGINEERING.name());
        createPostRequest.param("broadcast", "true");

        mockMvc.perform(createPostRequest);
View Full Code Here

    @Test
    public void createdPostValuesArePersisted() throws Exception {
        MockHttpServletRequestBuilder createPostRequest = getCreatePostRequest();
        createPostRequest.param("title", "Post Title");
        createPostRequest.param("content", "My Content");
        createPostRequest.param("category", PostCategory.ENGINEERING.name());
        createPostRequest.param("broadcast", "true");

        mockMvc.perform(createPostRequest);

        Post post = postRepository.findAll().get(0);
View Full Code Here

    public void createdPostValuesArePersisted() throws Exception {
        MockHttpServletRequestBuilder createPostRequest = getCreatePostRequest();
        createPostRequest.param("title", "Post Title");
        createPostRequest.param("content", "My Content");
        createPostRequest.param("category", PostCategory.ENGINEERING.name());
        createPostRequest.param("broadcast", "true");

        mockMvc.perform(createPostRequest);

        Post post = postRepository.findAll().get(0);
View Full Code Here

  @Test
  public void testCallExistsFormPostMethod() throws Exception {
    MockHttpServletRequestBuilder request = post("/router").accept(MediaType.ALL)
        .contentType(MediaType.APPLICATION_JSON).characterEncoding("UTF-8");

    request.param("extTID", "12");
    request.param("extAction", "formInfoController");
    request.param("extMethod", "updateInfo");
    request.param("extType", "rpc");
    request.param("name", "Ralph");
    request.param("age", "20");
View Full Code Here

  public void testCallExistsFormPostMethod() throws Exception {
    MockHttpServletRequestBuilder request = post("/router").accept(MediaType.ALL)
        .contentType(MediaType.APPLICATION_JSON).characterEncoding("UTF-8");

    request.param("extTID", "12");
    request.param("extAction", "formInfoController");
    request.param("extMethod", "updateInfo");
    request.param("extType", "rpc");
    request.param("name", "Ralph");
    request.param("age", "20");
    request.param("admin", "true");
View Full Code Here

    MockHttpServletRequestBuilder request = post("/router").accept(MediaType.ALL)
        .contentType(MediaType.APPLICATION_JSON).characterEncoding("UTF-8");

    request.param("extTID", "12");
    request.param("extAction", "formInfoController");
    request.param("extMethod", "updateInfo");
    request.param("extType", "rpc");
    request.param("name", "Ralph");
    request.param("age", "20");
    request.param("admin", "true");
    request.param("salary", "12.3");
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.