@Test public void exceptions_in_put4_should_be_rethrown_and_connection_released() { RestTemplate template = new RestTemplate(client); HttpResponse rsp = mock(HttpResponse.class); when(client.put(anyString(), any(InputStream.class), anyString(), anyInt())).thenReturn(rsp); when(rsp.isSuccessful()).thenReturn(Boolean.TRUE); template.put("/some/path", IOUtils.toInputStream("content"), "text/html", 12l); verify(client).put(eq("/some/path"), any(InputStream.class), eq("text/html"), eq(12l)); verify(rsp).releaseConnection(); }
public void put(String path) { handleVoidResponse(client.put(path)); }
RestTemplate { public void put(String path) { handleVoidResponse(client.put(path)); } }
RestTemplate { public void put(String path) { handleVoidResponse(client.put(path)); } RestTemplate(HttpClient client); }
RestTemplate { public void put(String path) { handleVoidResponse(client.put(path)); } RestTemplate(HttpClient client); T get(String path, ResponseCallback<T> callback); T getUncached(String path, ResponseCallback<T> callback); HttpResponse get(String path); HttpResponse getUncached(String path); void put(String path); T put(String path, ResponseCallback<T> callback); T put(String path, String content, ResponseCallback<T> callback); T put(String path, HttpEntity httpEntity, ResponseCallback<T> callback); T copy(String path, String destinationUri, ResponseCallback<T> callback); void put(String path, String content); void put(String path, HttpEntity httpEntity); void put(String path, InputStream data, String contentType,
			long contentLength); T put(String path, InputStream data, String contentType,
			long contentLength, ResponseCallback<T> callback); T post(String path, String content, ResponseCallback<T> callback); T post(String path, HttpEntity httpEntity, ResponseCallback<T> callback); T post(String path, InputStream content, ResponseCallback<T> callback); T postUncached(String path, String content, ResponseCallback<T> callback); HttpResponse post(String path, String content ); HttpResponse postUncached(String path, String content ); T delete(String path, ResponseCallback<T> callback); void delete(String path); T head(String path, ResponseCallback<T> callback); }
RestTemplate { public void put(String path) { handleVoidResponse(client.put(path)); } RestTemplate(HttpClient client); T get(String path, ResponseCallback<T> callback); T getUncached(String path, ResponseCallback<T> callback); HttpResponse get(String path); HttpResponse getUncached(String path); void put(String path); T put(String path, ResponseCallback<T> callback); T put(String path, String content, ResponseCallback<T> callback); T put(String path, HttpEntity httpEntity, ResponseCallback<T> callback); T copy(String path, String destinationUri, ResponseCallback<T> callback); void put(String path, String content); void put(String path, HttpEntity httpEntity); void put(String path, InputStream data, String contentType,
			long contentLength); T put(String path, InputStream data, String contentType,
			long contentLength, ResponseCallback<T> callback); T post(String path, String content, ResponseCallback<T> callback); T post(String path, HttpEntity httpEntity, ResponseCallback<T> callback); T post(String path, InputStream content, ResponseCallback<T> callback); T postUncached(String path, String content, ResponseCallback<T> callback); HttpResponse post(String path, String content ); HttpResponse postUncached(String path, String content ); T delete(String path, ResponseCallback<T> callback); void delete(String path); T head(String path, ResponseCallback<T> callback);  }