org.springframework.boot.test

Class TestRestTemplate

  • java.lang.Object
    • org.springframework.http.client.support.HttpAccessor
      • org.springframework.http.client.support.InterceptingHttpAccessor
        • org.springframework.web.client.RestTemplate
          • org.springframework.boot.test.TestRestTemplate
  • All Implemented Interfaces:
    org.springframework.web.client.RestOperations


    public class TestRestTemplate
    extends org.springframework.web.client.RestTemplate
    Convenient subclass of RestTemplate that is suitable for integration tests. They are fault tolerant, and optionally can carry Basic authentication headers. If Apache Http Client 4.3.2 or better is available (recommended) it will be used as the client, and by default configured to ignore cookies and redirects.
    Author:
    Dave Syer, Phillip Webb
    • Field Summary

      • Fields inherited from class org.springframework.http.client.support.HttpAccessor

        logger
    • Method Summary

      • Methods inherited from class org.springframework.web.client.RestTemplate

        acceptHeaderRequestCallback, delete, delete, delete, doExecute, exchange, exchange, exchange, exchange, exchange, exchange, execute, execute, execute, getErrorHandler, getForEntity, getForEntity, getForEntity, getForObject, getForObject, getForObject, getMessageConverters, headersExtractor, headForHeaders, headForHeaders, headForHeaders, httpEntityCallback, httpEntityCallback, optionsForAllow, optionsForAllow, optionsForAllow, postForEntity, postForEntity, postForEntity, postForLocation, postForLocation, postForLocation, postForObject, postForObject, postForObject, put, put, put, responseEntityExtractor, setErrorHandler, setMessageConverters
      • Methods inherited from class org.springframework.http.client.support.InterceptingHttpAccessor

        getInterceptors, getRequestFactory, setInterceptors
      • Methods inherited from class org.springframework.http.client.support.HttpAccessor

        createRequest, setRequestFactory
    • Constructor Detail

      • TestRestTemplate

        public TestRestTemplate(String username,
                        String password,
                        TestRestTemplate.HtppClientOption... httpClientOptions)
        Create a new TestRestTemplate instance with the specified credentials.
        Parameters:
        username - the username to use (or null)
        password - the password (or null)
        httpClientOptions - client options to use if the Apache HTTP Client is used

Copyright © 2014 Pivotal Software, Inc.. All rights reserved.