You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ta...@apache.org on 2022/05/27 17:57:12 UTC

[tika] branch main updated: TIKA-3776 -- checkstyle fixes

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

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


The following commit(s) were added to refs/heads/main by this push:
     new 47fa2b92d TIKA-3776 -- checkstyle fixes
47fa2b92d is described below

commit 47fa2b92d3c8437866a86bbc0204e463be2f47bc
Author: tallison <ta...@apache.org>
AuthorDate: Fri May 27 13:57:01 2022 -0400

    TIKA-3776 -- checkstyle fixes
---
 .../tika/pipes/fetcher/http/HttpFetcherTest.java   | 29 +++++++++++-----------
 1 file changed, 14 insertions(+), 15 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 c4d83e188..3926710de 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
@@ -18,8 +18,9 @@ package org.apache.tika.pipes.fetcher.http;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.mockito.ArgumentMatchers.*;
-import static org.mockito.Mockito.*;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -40,18 +41,16 @@ import org.apache.http.StatusLine;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.methods.HttpUriRequest;
 import org.apache.http.protocol.HttpContext;
-import org.apache.tika.client.HttpClientFactory;
-import org.apache.tika.exception.TikaException;
-import org.apache.tika.metadata.Property;
-import org.apache.tika.metadata.TikaCoreProperties;
-import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 
 import org.apache.tika.TikaTest;
+import org.apache.tika.client.HttpClientFactory;
+import org.apache.tika.exception.TikaException;
 import org.apache.tika.io.TemporaryResources;
 import org.apache.tika.metadata.Metadata;
+import org.apache.tika.metadata.TikaCoreProperties;
 import org.apache.tika.pipes.fetcher.FetcherManager;
 
 public class HttpFetcherTest extends TikaTest {
@@ -63,8 +62,8 @@ public class HttpFetcherTest extends TikaTest {
 
     @BeforeEach
     public void before() throws Exception {
-        final HttpResponse mockResponse =
-                buildMockResponse(HttpStatus.SC_OK, IOUtils.toInputStream(CONTENT, Charset.defaultCharset()));
+        final HttpResponse mockResponse = buildMockResponse(HttpStatus.SC_OK,
+                IOUtils.toInputStream(CONTENT, Charset.defaultCharset()));
 
         mockClientResponse(mockResponse);
     }
@@ -106,8 +105,7 @@ public class HttpFetcherTest extends TikaTest {
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         Metadata metadata = new Metadata();
         HttpFetcher httpFetcher =
-                (HttpFetcher) getFetcherManager("tika-config-http.xml")
-                        .getFetcher("http");
+                (HttpFetcher) getFetcherManager("tika-config-http.xml").getFetcher("http");
         try (InputStream is = httpFetcher.fetch(url, metadata)) {
             IOUtils.copy(is, bos);
         }
@@ -123,8 +121,7 @@ public class HttpFetcherTest extends TikaTest {
         long end = start + 1408 - 1;
         Metadata metadata = new Metadata();
         HttpFetcher httpFetcher =
-                (HttpFetcher) getFetcherManager("tika-config-http.xml")
-                        .getFetcher("http");
+                (HttpFetcher) getFetcherManager("tika-config-http.xml").getFetcher("http");
         try (TemporaryResources tmp = new TemporaryResources()) {
             Path tmpPath = tmp.createTempFile();
             try (InputStream is = httpFetcher.fetch(url, start, end, metadata)) {
@@ -146,7 +143,8 @@ public class HttpFetcherTest extends TikaTest {
         final HttpClient httpClient = mock(HttpClient.class);
         final HttpClientFactory clientFactory = mock(HttpClientFactory.class);
 
-        when(httpClient.execute(any(HttpUriRequest.class), any(HttpContext.class))).thenReturn(response);
+        when(httpClient.execute(
+                any(HttpUriRequest.class), any(HttpContext.class))).thenReturn(response);
         when(clientFactory.build()).thenReturn(httpClient);
         when(clientFactory.copy()).thenReturn(clientFactory);
 
@@ -154,7 +152,8 @@ public class HttpFetcherTest extends TikaTest {
         httpFetcher.initialize(Collections.emptyMap());
     }
 
-    private static HttpResponse buildMockResponse(final int statusCode, final InputStream is) throws IOException {
+    private static HttpResponse buildMockResponse(final int statusCode, final InputStream is)
+            throws IOException {
         final HttpResponse response = mock(HttpResponse.class);
         final StatusLine status = mock(StatusLine.class);
         final HttpEntity entity = mock(HttpEntity.class);