Package org.springframework.web.client

Examples of org.springframework.web.client.DefaultResponseErrorHandler


      private ResponseErrorHandler errorHandler = super.getResponseErrorHandler();

      @Override
      protected ResponseErrorHandler getResponseErrorHandler() {
        return new DefaultResponseErrorHandler() {
          public void handleError(ClientHttpResponse response) throws IOException {
            response.getHeaders();
            response.getStatusCode();
            tokenEndpointResponse = response;
            errorHandler.handleError(response);
View Full Code Here


      private ResponseErrorHandler errorHandler = super.getResponseErrorHandler();

      @Override
      protected ResponseErrorHandler getResponseErrorHandler() {
        return new DefaultResponseErrorHandler() {
          public void handleError(ClientHttpResponse response) throws IOException {
            response.getHeaders();
            response.getStatusCode();
            tokenEndpointResponse = response;
            errorHandler.handleError(response);
View Full Code Here

      private ResponseErrorHandler errorHandler = super.getResponseErrorHandler();

      @Override
      protected ResponseErrorHandler getResponseErrorHandler() {
        return new DefaultResponseErrorHandler() {
          public void handleError(ClientHttpResponse response) throws IOException {
            response.getHeaders();
            response.getStatusCode();
            tokenEndpointResponse = response;
            errorHandler.handleError(response);
View Full Code Here

      private ResponseErrorHandler errorHandler = super.getResponseErrorHandler();

      @Override
      protected ResponseErrorHandler getResponseErrorHandler() {
        return new DefaultResponseErrorHandler() {
          public void handleError(ClientHttpResponse response) throws IOException {
            response.getHeaders();
            response.getStatusCode();
            tokenEndpointResponse = response;
            errorHandler.handleError(response);
View Full Code Here

  @OAuth2ContextConfiguration(resource = InvalidClientCredentials.class, initialize = false)
  public void testInvalidCredentials() throws Exception {
    context.setAccessTokenProvider(new ClientCredentialsAccessTokenProvider() {
      @Override
      protected ResponseErrorHandler getResponseErrorHandler() {
        return new DefaultResponseErrorHandler() {
          public void handleError(ClientHttpResponse response) throws IOException {
            responseHeaders = response.getHeaders();
            responseStatus = response.getStatusCode();
          }
        };
View Full Code Here

            .setAuthenticationEnabled(false).setRedirectsEnabled(false);
        context.setRequestConfig(builder.build());
        return context;
      }
    });
    client.setErrorHandler(new DefaultResponseErrorHandler() {
      @Override
      public boolean hasError(ClientHttpResponse response) throws IOException {
        return false;
      }
    });
View Full Code Here

    log.info("Closed");
  }

  protected RestTemplate getRestTemplate() {
    RestTemplate restTemplate = new RestTemplate();
    restTemplate.setErrorHandler(new DefaultResponseErrorHandler() {
      @Override
      public void handleError(ClientHttpResponse response)
          throws IOException {
      }
    });
View Full Code Here

        return getRestTemplate().getForEntity(serverAddress + path, String.class);
    }

    private RestTemplate getRestTemplate() {
        RestTemplate restTemplate = new RestTemplate();
        restTemplate.setErrorHandler(new DefaultResponseErrorHandler() {
            @Override
            public boolean hasError(ClientHttpResponse response) throws IOException {
                return false;
            }
        });
View Full Code Here

        /**
         * Check for error HTTP status code in response message.
         * Delegates to default Spring implementation.
         */
        public boolean hasError(ClientHttpResponse response) throws IOException {
            return new DefaultResponseErrorHandler().hasError(response);
        }
View Full Code Here

            if (getEndpointConfiguration().getErrorHandlingStrategy().equals(ErrorHandlingStrategy.PROPAGATE)) {
                Message responseMessage = getEndpointConfiguration().getMessageConverter().convertInbound(
                        new ResponseEntity(response.getBody(), response.getHeaders(), response.getStatusCode()), getEndpointConfiguration());
                onReplyMessage(correlationKey, responseMessage);
            } else if (getEndpointConfiguration().getErrorHandlingStrategy().equals(ErrorHandlingStrategy.THROWS_EXCEPTION)) {
                new DefaultResponseErrorHandler().handleError(response);
            } else {
                throw new CitrusRuntimeException("Unsupported error strategy: " + getEndpointConfiguration().getErrorHandlingStrategy());
            }
        }
View Full Code Here

TOP

Related Classes of org.springframework.web.client.DefaultResponseErrorHandler

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.