[JAVA-31566] Upgrade okhttp to latest version (#15983)

This commit is contained in:
panos-kakos
2024-03-04 08:39:28 +01:00
committed by GitHub
parent 4f0a8ce5d9
commit 95a8bbe3f2
11 changed files with 37 additions and 25 deletions
+2 -2
View File
@@ -109,9 +109,9 @@
</build>
<properties>
<okhttp.version>4.12.0</okhttp.version>
<okhttp.version>5.0.0-alpha.12</okhttp.version>
<gson.version>2.10.1</gson.version>
<mockwebserver.version>4.9.1</mockwebserver.version>
<mockwebserver.version>5.0.0-alpha.12</mockwebserver.version>
<jetty.httpclient.version>1.0.3</jetty.httpclient.version>
<jetty.server.version>9.4.19.v20190610</jetty.server.version>
<rxjava2.version>2.2.11</rxjava2.version>
@@ -52,17 +52,10 @@ public class BinaryFileDownloaderUnitTest {
verify(writer).close();
}
@Test(expected = IllegalStateException.class)
public void givenUrlAndResponseWithNullBody_whenDownload_thenExpectIllegalStateException() throws Exception {
@Test(expected = NullPointerException.class)
public void givenUrlAndResponseWithNullBody_whenDownload_thenExpectNullPointerException() throws Exception {
String url = "http://example.com/file";
Call call = mock(Call.class);
when(client.newCall(any(Request.class))).thenReturn(call);
Response response = createResponse(url, null);
when(call.execute()).thenReturn(response);
tested.download(url);
verify(writer, times(0)).write(any(InputStream.class), anyDouble());
}
@NotNull