Package org.springframework.test.web.server

Examples of org.springframework.test.web.server.StubMvcResult


  private StubMvcResult getStubMvcResult() throws Exception {
    MockHttpServletResponse response = new MockHttpServletResponse();
    response.addHeader("Content-Type", "application/json");
    response.getWriter().print(new String(RESPONSE_CONTENT.getBytes("ISO-8859-1")));
    return new StubMvcResult(null, null, null, null, null, null, response);
  }
View Full Code Here


  }

  private StubMvcResult getStubMvcResult() {
    FlashMap flashMap = new FlashMap();
    flashMap.put("good", "good");
    StubMvcResult mvcResult = new StubMvcResult(null, null, null, null, null, flashMap, null);
    return mvcResult;
  }
View Full Code Here

  @Before
  public void setup() {
    this.handler = new TestPrintingResultHandler();
    this.request = new MockHttpServletRequest("GET", "/");
    this.response = new MockHttpServletResponse();
    this.mvcResult = new StubMvcResult(this.request, null, null, null, null, null, this.response);
  }
View Full Code Here

    assertValue("MockHttpServletResponse", "Redirected URL", this.response.getRedirectedUrl());
  }

  @Test
  public void testPrintHandlerNull() throws Exception {
    StubMvcResult mvcResult = new StubMvcResult(this.request, null, null, null, null, null, this.response);
    this.handler.handle(mvcResult);

    assertValue("Handler", "Type", null);
  }
View Full Code Here

  private StubMvcResult getStubMvcResult() throws Exception {
    MockHttpServletResponse response = new MockHttpServletResponse();
    response.addHeader("Content-Type", "application/json");
    response.getWriter().print(new String(RESPONSE_CONTENT.getBytes("ISO-8859-1")));
    return new StubMvcResult(null, null, null, null, null, null, response);
  }
View Full Code Here

  private StubMvcResult getStubMvcResult() throws Exception {
    MockHttpServletResponse response = new MockHttpServletResponse();
    response.addHeader("Content-Type", "application/json; charset=UTF-8");
    response.getWriter().print(new String(CONTENT.getBytes("UTF-8")));
    return new StubMvcResult(null, null, null, null, null, null, response);
  }
View Full Code Here

  public void attributeHasFieldErrors_withoutErrorsForField() throws Exception {
    this.matchers.attributeHasFieldErrors("date", "good", "time").match(this.mvcResultWithError);
  }

  private MvcResult getMvcResult(ModelAndView modelAndView) {
    return new StubMvcResult(null, null, null, null, modelAndView, null, null);
  }
View Full Code Here

      String methodName = statusToMethodName(status);
      Method method = StatusResultMatchers.class.getMethod(methodName);
      try {
        ResultMatcher matcher = (ResultMatcher) ReflectionUtils.invokeMethod(method, resultMatchers);
        try {
          MvcResult mvcResult = new StubMvcResult(new MockHttpServletRequest(), null, null, null, null, null, response);
          matcher.match(mvcResult);
        }
        catch (AssertionError error) {
          failures.add(error);
        }
View Full Code Here

TOP

Related Classes of org.springframework.test.web.server.StubMvcResult

Copyright © 2018 www.massapicom. 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.