|
32 | 32 | import org.junit.Test; |
33 | 33 |
|
34 | 34 | import java.io.IOException; |
| 35 | +import java.net.SocketException; |
35 | 36 | import java.net.SocketTimeoutException; |
36 | 37 | import java.util.Set; |
37 | 38 |
|
@@ -101,6 +102,21 @@ public void testBaseServiceException() { |
101 | 102 | serviceException = new BaseServiceException(exception, true); |
102 | 103 | assertTrue(serviceException.retryable()); |
103 | 104 | assertTrue(serviceException.idempotent()); |
| 105 | + assertNull(serviceException.getMessage()); |
| 106 | + assertEquals(exception, serviceException.getCause()); |
| 107 | + |
| 108 | + exception = new SocketException(); |
| 109 | + serviceException = new BaseServiceException(exception, true); |
| 110 | + assertTrue(serviceException.retryable()); |
| 111 | + assertTrue(serviceException.idempotent()); |
| 112 | + assertNull(serviceException.getMessage()); |
| 113 | + assertEquals(exception, serviceException.getCause()); |
| 114 | + |
| 115 | + exception = new IOException("insufficient data written"); |
| 116 | + serviceException = new BaseServiceException(exception, true); |
| 117 | + assertTrue(serviceException.retryable()); |
| 118 | + assertTrue(serviceException.idempotent()); |
| 119 | + assertEquals("insufficient data written", serviceException.getMessage()); |
104 | 120 | assertEquals(exception, serviceException.getCause()); |
105 | 121 |
|
106 | 122 | GoogleJsonError error = new GoogleJsonError(); |
|
0 commit comments