Package org.springframework.test.web.client

Examples of org.springframework.test.web.client.ResponseCreator


   * @deprecated in favor of methods returning DefaultResponseCreator
   */
  public static ResponseCreator withResponse(final String body, final HttpHeaders headers,
      final HttpStatus statusCode, final String statusText) {

    return new ResponseCreator() {
      public MockClientHttpResponse createResponse(ClientHttpRequest request) throws IOException {
        MockClientHttpResponse response = new MockClientHttpResponse(body.getBytes("UTF-8"), statusCode);
        response.getHeaders().putAll(headers);
        return response;
      }
View Full Code Here


   * @deprecated in favor of methods 'withXyz' in this class returning DefaultResponseCreator
   */
  public static ResponseCreator withResponse(final Resource body, final HttpHeaders headers,
      final HttpStatus statusCode, String statusText) {

    return new ResponseCreator() {
      public MockClientHttpResponse createResponse(ClientHttpRequest request) throws IOException {
        MockClientHttpResponse response = new MockClientHttpResponse(body.getInputStream(), statusCode);
        response.getHeaders().putAll(headers);
        return response;
      }
View Full Code Here

TOP

Related Classes of org.springframework.test.web.client.ResponseCreator

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.