-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Closed
Description
Originally raised here
Just a note about this: I discovered this issue when I called the method TestRestTemplate.withBasicAuth(String username, String password)
.
Inside that method is the call:
restTemplate.setErrorHandler(getRestTemplate().getErrorHandler());
...which sets the new RestTemplate
's ErrorHandler with the current one. But then later in the method the TestRestTemplate
constructor is called which then (re-)sets the just-set ResponseErrorHandler
back to NoOpResponseErrorHandler
.
This logic, along with the description in the javadoc for this method (Creates a new {@code TestRestTemplate} with the same configuration as this one
), implies that the RestTemplate config should be the same as it was coming in, but it sets it to NoOpResponseErrorHandler
regardless of the previous state.
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug