|
31 | 31 | import okhttp3.Credentials;
|
32 | 32 | import okhttp3.OkHttpClient;
|
33 | 33 | import okhttp3.Request;
|
| 34 | +import okhttp3.Response; |
34 | 35 | import okhttp3.mockwebserver.MockResponse;
|
35 | 36 | import okhttp3.mockwebserver.RecordedRequest;
|
36 | 37 | import org.assertj.core.api.Assertions;
|
@@ -67,7 +68,8 @@ void authorizationNone() throws IOException, InterruptedException {
|
67 | 68 | .get()
|
68 | 69 | .build();
|
69 | 70 |
|
70 |
| - buildOkHttpClient(options).newCall(request).execute(); |
| 71 | + Response response = buildOkHttpClient(options).newCall(request).execute(); |
| 72 | + response.close(); |
71 | 73 |
|
72 | 74 | Assertions.assertThat(mockServer.getRequestCount()).isEqualTo(1);
|
73 | 75 |
|
@@ -103,7 +105,8 @@ void authorizationSession() throws IOException, InterruptedException {
|
103 | 105 | .get()
|
104 | 106 | .build();
|
105 | 107 |
|
106 |
| - buildOkHttpClient(options).newCall(request).execute(); |
| 108 | + Response response = buildOkHttpClient(options).newCall(request).execute(); |
| 109 | + response.close(); |
107 | 110 |
|
108 | 111 | // Sign in request
|
109 | 112 | RecordedRequest requestToSignIn = mockServer.takeRequest();
|
@@ -138,7 +141,8 @@ void authorizationSessionWithoutCookie() throws IOException, InterruptedExceptio
|
138 | 141 | .get()
|
139 | 142 | .build();
|
140 | 143 |
|
141 |
| - buildOkHttpClient(options).newCall(request).execute(); |
| 144 | + Response response = buildOkHttpClient(options).newCall(request).execute(); |
| 145 | + response.close(); |
142 | 146 |
|
143 | 147 | // Sign in request in init
|
144 | 148 | RecordedRequest requestToSignIn = mockServer.takeRequest();
|
@@ -213,7 +217,8 @@ void authorizationToken() throws IOException, InterruptedException {
|
213 | 217 | .get()
|
214 | 218 | .build();
|
215 | 219 |
|
216 |
| - buildOkHttpClient(options).newCall(request).execute(); |
| 220 | + Response response = buildOkHttpClient(options).newCall(request).execute(); |
| 221 | + response.close(); |
217 | 222 |
|
218 | 223 | RecordedRequest recordedRequest = mockServer.takeRequest();
|
219 | 224 | Assertions.assertThat(recordedRequest.getHeader("Authorization")).isEqualTo("Token xyz");
|
|
0 commit comments