Package org.springframework.mock.web.test

Examples of org.springframework.mock.web.test.MockHttpServletRequest.removeParameter()


    request.addParameter("_postProcessed", "visible");
    request.addParameter("postProcessed", "on");
    binder.bind(new ServletWebRequest(request));
    assertTrue(target.isPostProcessed());

    request.removeParameter("postProcessed");
    binder.bind(new ServletWebRequest(request));
    assertTrue(target.isPostProcessed());

    request.removeParameter("!postProcessed");
    binder.bind(new ServletWebRequest(request));
View Full Code Here


    request.removeParameter("postProcessed");
    binder.bind(new ServletWebRequest(request));
    assertTrue(target.isPostProcessed());

    request.removeParameter("!postProcessed");
    binder.bind(new ServletWebRequest(request));
    assertFalse(target.isPostProcessed());
  }

  @Test
View Full Code Here

    request.addParameter("!name", "anonymous");
    request.addParameter("name", "Scott");
    binder.bind(new ServletWebRequest(request));
    assertEquals("Scott", target.getName());

    request.removeParameter("name");
    binder.bind(new ServletWebRequest(request));
    assertEquals("anonymous", target.getName());
  }

  @Test
View Full Code Here

    request.addParameter("stringArray", "abc");
    request.addParameter("stringArray", "123,def");
    binder.bind(new ServletWebRequest(request));
    assertEquals("Expected all three items to be bound", 3, target.getStringArray().length);

    request.removeParameter("stringArray");
    request.addParameter("stringArray", "123,def");
    binder.bind(new ServletWebRequest(request));
    assertEquals("Expected only 1 item to be bound", 1, target.getStringArray().length);
  }
View Full Code Here

    request.addParameter("_postProcessed", "visible");
    request.addParameter("postProcessed", "on");
    binder.bind(new ServletWebRequest(request));
    assertTrue(target.isPostProcessed());

    request.removeParameter("postProcessed");
    binder.bind(new ServletWebRequest(request));
    assertFalse(target.isPostProcessed());
  }

  @Test
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.