|
45 | 45 | import java.util.concurrent.CountDownLatch; |
46 | 46 | import java.util.concurrent.ExecutorService; |
47 | 47 | import java.util.concurrent.Executors; |
| 48 | +import java.util.concurrent.TimeoutException; |
48 | 49 | import java.util.logging.Logger; |
49 | 50 | import org.junit.After; |
50 | 51 | import org.junit.Before; |
@@ -77,7 +78,10 @@ public void tearDown() throws Exception { |
77 | 78 |
|
78 | 79 | @Test |
79 | 80 | public void callS2AServerOnce_getTlsConfiguration_returnsValidResult() |
80 | | - throws InterruptedException, IOException, java.util.concurrent.ExecutionException { |
| 81 | + throws InterruptedException, |
| 82 | + IOException, |
| 83 | + java.util.concurrent.ExecutionException, |
| 84 | + TimeoutException { |
81 | 85 | ExecutorService executor = Executors.newSingleThreadExecutor(); |
82 | 86 | logger.info("Client connecting to: " + serverAddress); |
83 | 87 | ManagedChannel channel = |
@@ -121,6 +125,7 @@ public void onCompleted() { |
121 | 125 | // Mark the end of requests. |
122 | 126 | requestObserver.onCompleted(); |
123 | 127 | // Wait for receiving to happen. |
| 128 | + respFuture.get(5, SECONDS); |
124 | 129 | } finally { |
125 | 130 | channel.shutdown(); |
126 | 131 | channel.awaitTermination(1, SECONDS); |
@@ -165,7 +170,7 @@ public void onCompleted() { |
165 | 170 |
|
166 | 171 | @Test |
167 | 172 | public void callS2AServerOnce_validatePeerCertifiate_returnsValidResult() |
168 | | - throws InterruptedException, java.util.concurrent.ExecutionException { |
| 173 | + throws InterruptedException, java.util.concurrent.ExecutionException, TimeoutException { |
169 | 174 | ExecutorService executor = Executors.newSingleThreadExecutor(); |
170 | 175 | logger.info("Client connecting to: " + serverAddress); |
171 | 176 | ManagedChannel channel = |
@@ -212,6 +217,7 @@ public void onCompleted() { |
212 | 217 | // Mark the end of requests. |
213 | 218 | requestObserver.onCompleted(); |
214 | 219 | // Wait for receiving to happen. |
| 220 | + respFuture.get(5, SECONDS); |
215 | 221 | } finally { |
216 | 222 | channel.shutdown(); |
217 | 223 | channel.awaitTermination(1, SECONDS); |
|
0 commit comments