This is an automated email from the ASF dual-hosted git repository.

tilman pushed a commit to branch branch_3x
in repository https://gitbox.apache.org/repos/asf/tika.git


The following commit(s) were added to refs/heads/branch_3x by this push:
     new 901769480d [TIKA-4704] close input (#2724)
901769480d is described below

commit 901769480d4a3c77cfa60019dc553302344540ef
Author: Tilman Hausherr <[email protected]>
AuthorDate: Mon Mar 30 22:23:45 2026 +0200

    [TIKA-4704] close input (#2724)
    
    * [TIKA-4704] close input
    
    * Update 
tika-pipes/tika-pipes-plugins/tika-pipes-http/src/test/java/org/apache/tika/pipes/fetcher/http/HttpFetcherTest.java
    
    Co-authored-by: Copilot <[email protected]>
    
    * Refactor HttpFetcherTest to use try-with-resources
    
    ---------
    
    Co-authored-by: Copilot <[email protected]>
---
 .../java/org/apache/tika/pipes/fetcher/http/HttpFetcherTest.java    | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/tika-pipes/tika-fetchers/tika-fetcher-http/src/test/java/org/apache/tika/pipes/fetcher/http/HttpFetcherTest.java
 
b/tika-pipes/tika-fetchers/tika-fetcher-http/src/test/java/org/apache/tika/pipes/fetcher/http/HttpFetcherTest.java
index c888db8ae1..70a8017b5e 100644
--- 
a/tika-pipes/tika-fetchers/tika-fetcher-http/src/test/java/org/apache/tika/pipes/fetcher/http/HttpFetcherTest.java
+++ 
b/tika-pipes/tika-fetchers/tika-fetcher-http/src/test/java/org/apache/tika/pipes/fetcher/http/HttpFetcherTest.java
@@ -206,7 +206,8 @@ class HttpFetcherTest extends TikaTest {
         headersMapFromConfig.put("fromFetchConfig2", 
List.of("fromFetchConfigValue2", "fromFetchConfigValue3"));
         
httpFetcher.getHttpFetcherConfig().getHttpRequestHeaders().setMap(headersMapFromConfig);
 
-        httpFetcher.fetch("http://localhost";, metadata, parseContext);
+        try (InputStream ignored = httpFetcher.fetch("http://localhost";, 
metadata, parseContext)) {
+        }
         HttpGet httpGet = httpGetArgumentCaptor.getValue();
         Assertions.assertEquals("fromFetchRequestValue1", 
httpGet.getHeaders("fromFetchRequestHeader1")[0].getValue());
         List<String> fromFetchRequestHeader2s = 
Arrays.stream(httpGet.getHeaders("fromFetchRequestHeader2"))
@@ -227,7 +228,8 @@ class HttpFetcherTest extends TikaTest {
         Assertions.assertEquals("fromFetchConfigValue3", 
fromFetchConfig2s.get(1));
 
         metadata.set(Property.externalText("httpRequestHeaders"), new String[] 
{" nick1 :   val1", "nick2:   val2"});
-        httpFetcher.fetch("http://localhost";, metadata, parseContext);
+        try (InputStream ignored = httpFetcher.fetch("http://localhost";, 
metadata, parseContext)) {
+        }
         httpGet = httpGetArgumentCaptor.getValue();
         Assertions.assertEquals("val1", 
httpGet.getHeaders("nick1")[0].getValue());
         Assertions.assertEquals("val2", 
httpGet.getHeaders("nick2")[0].getValue());

Reply via email to