|
17 | 17 |
|
18 | 18 | package com.thoughtworks.selenium; |
19 | 19 |
|
20 | | -import static org.junit.jupiter.api.Assertions.assertArrayEquals; |
21 | | -import static org.junit.jupiter.api.Assertions.assertEquals; |
22 | | -import static org.junit.jupiter.api.Assertions.fail; |
23 | | -import static org.mockito.Mockito.doReturn; |
24 | | -import static org.mockito.Mockito.spy; |
25 | | - |
26 | 20 | import org.junit.jupiter.api.Test; |
27 | 21 |
|
28 | 22 | import java.io.IOException; |
|
33 | 27 | import java.net.HttpURLConnection; |
34 | 28 | import java.net.URL; |
35 | 29 |
|
| 30 | +import static org.junit.jupiter.api.Assertions.assertArrayEquals; |
| 31 | +import static org.junit.jupiter.api.Assertions.assertEquals; |
| 32 | +import static org.junit.jupiter.api.Assertions.fail; |
| 33 | +import static org.mockito.Mockito.doReturn; |
| 34 | +import static org.mockito.Mockito.spy; |
| 35 | + |
36 | 36 | /** |
37 | 37 | * {@link com.thoughtworks.selenium.HttpCommandProcessor} unit test class. |
38 | 38 | */ |
@@ -102,15 +102,12 @@ public void testResourcesClosedWhenIoeOnGetInputStream() { |
102 | 102 | } |
103 | 103 |
|
104 | 104 | @Test |
105 | | - public void testResourcesClosedWhenNoIoes() { |
| 105 | + public void testResourcesClosedWhenNoIoes() throws IOException { |
106 | 106 | IOEThrowingHttpCommandProcessor cmdProc = new IOEThrowingHttpCommandProcessor( |
107 | 107 | "localhost", 4444, "*chrome", "http://www.google.com"); |
108 | | - try { |
109 | | - cmdProc.getCommandResponseAsString("testCommand"); |
110 | | - cmdProc.verifyClosedResources(true, true, true); |
111 | | - } catch (IOException ioe) { |
112 | | - fail(); |
113 | | - } |
| 108 | + |
| 109 | + cmdProc.getCommandResponseAsString("testCommand"); |
| 110 | + cmdProc.verifyClosedResources(true, true, true); |
114 | 111 | } |
115 | 112 |
|
116 | 113 | @Test |
|
0 commit comments