@SuppressWarnings("unchecked") @Test public void put3_should_call_success_in_callback_and_release_connection() throws Exception { RestTemplate template = new RestTemplate(client); ResponseCallback<String> callback = mock(ResponseCallback.class); HttpResponse rsp = mock(HttpResponse.class); when(client.put(anyString(), anyString())).thenReturn(rsp); when(rsp.isSuccessful()).thenReturn(Boolean.TRUE); template.put("some_path", "content", callback); verify(callback).success(any(HttpResponse.class)); 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);  }