Fixed Java 5 incompatibility causing a compile error with JDK 1.5

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1512719 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2013-08-10 14:20:10 +00:00
parent 38c7647050
commit da8ac20f45
1 changed files with 4 additions and 2 deletions

View File

@ -85,7 +85,7 @@ public class TestRetryExec {
Mockito.same(request),
Mockito.<HttpClientContext>any(),
Mockito.<HttpExecutionAware>any())).thenAnswer(new Answer<Object>() {
@Override
public Object answer(final InvocationOnMock invocationOnMock) throws Throwable {
final Object[] args = invocationOnMock.getArguments();
final HttpRequestWrapper wrapper = (HttpRequestWrapper) args[1];
@ -96,6 +96,7 @@ public class TestRetryExec {
wrapper.addHeader("Cookie", "monster");
throw new IOException("Ka-boom");
}
});
Mockito.when(retryHandler.retryRequest(
Mockito.<IOException>any(),
@ -159,13 +160,14 @@ public class TestRetryExec {
Mockito.same(request),
Mockito.<HttpClientContext>any(),
Mockito.<HttpExecutionAware>any())).thenAnswer(new Answer<Object>() {
@Override
public Object answer(final InvocationOnMock invocationOnMock) throws Throwable {
final Object[] args = invocationOnMock.getArguments();
final HttpEntityEnclosingRequest request = (HttpEntityEnclosingRequest) args[1];
request.getEntity().writeTo(new ByteArrayOutputStream());
throw new IOException("Ka-boom");
}
});
Mockito.when(retryHandler.retryRequest(
Mockito.<IOException>any(),