File tree 1 file changed +6
-3
lines changed
x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 75
75
76
76
public class HttpClientTests extends ESTestCase {
77
77
78
- private MockWebServer webServer = new MockWebServer ();
78
+ private final MockWebServer webServer = new MockWebServer ();
79
+ private final Environment environment = TestEnvironment .newEnvironment (Settings .builder ().put ("path.home" , createTempDir ()).build ());
80
+
79
81
private HttpClient httpClient ;
80
- private Environment environment = TestEnvironment .newEnvironment (Settings .builder ().put ("path.home" , createTempDir ()).build ());
81
82
82
83
@ Before
83
84
public void init () throws Exception {
@@ -91,7 +92,9 @@ public void init() throws Exception {
91
92
@ After
92
93
public void shutdown () throws IOException {
93
94
webServer .close ();
94
- httpClient .close ();
95
+ if (httpClient != null ) {
96
+ httpClient .close ();
97
+ }
95
98
}
96
99
97
100
public void testBasics () throws Exception {
You can’t perform that action at this time.
0 commit comments