Package org.springframework.mock.web.test

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


    values = ServletRequestUtils.getRequiredLongParameters(request, "param2");
    assertEquals(2, values.length);
    assertEquals(1, values[0]);
    assertEquals(2, values[1]);

    request.removeParameter("param2");
    try {
      ServletRequestUtils.getRequiredLongParameters(request, "param2");
      fail("Should have thrown ServletRequestBindingException");
    }
    catch (ServletRequestBindingException ex) {
View Full Code Here


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

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

  @Test
View Full Code Here

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

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

  @Test
View Full Code Here

    request.addParameter("!postProcessed", "off");
    request.addParameter("postProcessed", "on");
    binder.bind(request);
    assertTrue(target.isPostProcessed());

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

  @Test
View Full Code Here

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

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

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

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

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

  @Test
View Full Code Here

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

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

  @Test
View Full Code Here

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

    request.removeParameter("stringArray");
    request.addParameter("stringArray", "123,def");
    binder.bind(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

    request.addParameter("!postProcessed", "off");
    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.