Skip to content

Commit

Permalink
cosmetic: eliminate code warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseifert committed Jul 17, 2024
1 parent 7caba19 commit c02802f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@
import org.apache.http.HttpHost;
import org.apache.http.HttpRequest;
import org.apache.http.HttpRequestInterceptor;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.AuthState;
import org.apache.http.auth.Credentials;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.conn.ConnectionKeepAliveStrategy;
import org.apache.http.conn.ssl.NoopHostnameVerifier;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
Expand Down Expand Up @@ -104,13 +102,8 @@ public PackageManagerHelper(PackageManagerProperties props) {
*/
public @NotNull CloseableHttpClient getHttpClient() {
HttpClientBuilder httpClientBuilder = HttpClients.custom()
.setKeepAliveStrategy(new ConnectionKeepAliveStrategy() {
@Override
public long getKeepAliveDuration(HttpResponse response, HttpContext context) {
// keep reusing connections to a minimum - may conflict when instance is restarting and responds in unexpected manner
return 1;
}
})
// keep reusing connections to a minimum - may conflict when instance is restarting and responds in unexpected manner
.setKeepAliveStrategy((response, context) -> 1)
.addInterceptorFirst(new HttpRequestInterceptor() {
@Override
public void process(HttpRequest request, HttpContext context) throws HttpException, IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public final class BundleStatus {
* @return Status Line from JSON string
* @deprecated Please use {@link #getStatusLineCompact()}
*/
@Deprecated
@Deprecated(since = "1.6.0")
public String getStatusLine() {
return this.statusLine;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void setUp() throws Exception {
}

@Test
void testGetStatus() throws Exception {
void testGetStatus() {
assertEquals(PackageInstalledStatus.NOT_FOUND, underTest.getStatus("invalidgroup", "invalidpackage", "1.0.0"));
assertEquals(PackageInstalledStatus.INSTALLED, underTest.getStatus("day/cq60/product", "cq-wcm-content", "6.3.214"));
assertEquals(PackageInstalledStatus.INSTALLED_OTHER_VERSION, underTest.getStatus("Netcentric", "accesscontroltool-package", "2.0.6"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ class ContentUnpackerTest {
private ContentUnpacker underTest;

@BeforeEach
void setUp() throws Exception {
void setUp() {
props = new ContentUnpackerProperties();
props.setExcludeFiles(EXCLUDE_FILES);
props.setExcludeNodes(EXCLUDE_NODES);
props.setExcludeProperties(EXCLUDE_PROPERTIES);
}

@Test
void testUnpack() throws Exception {
void testUnpack() {
File contentPackage = new File("src/test/resources/content-package-test.zip");
File outputDirectory = new File("target/unpacktest");
outputDirectory.mkdirs();
Expand All @@ -74,7 +74,7 @@ void testUnpack() throws Exception {
}

@Test
void testUnpack_MarkReplicationActivated() throws Exception {
void testUnpack_MarkReplicationActivated() {
File contentPackage = new File("src/test/resources/content-package-test.zip");
File outputDirectory = new File("target/unpacktest-MarkReplicationActivated");
outputDirectory.mkdirs();
Expand All @@ -94,7 +94,7 @@ void testUnpack_MarkReplicationActivated() throws Exception {
}

@Test
void testUnpack_MarkReplicationActivated_IncludeNodes() throws Exception {
void testUnpack_MarkReplicationActivated_IncludeNodes() {
File contentPackage = new File("src/test/resources/content-package-test.zip");
File outputDirectory = new File("target/unpacktest-MarkReplicationActivated_IncludeNodes");
outputDirectory.mkdirs();
Expand Down

0 comments on commit c02802f

Please sign in to comment.