Skip to content

Commit

Permalink
Fix checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
dheid committed Nov 3, 2023
1 parent 0231d55 commit 99de7cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
10 changes: 6 additions & 4 deletions src/main/java/org/matomo/java/tracking/Sender.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@
@RequiredArgsConstructor
class Sender {

private static final TrustManager[] TRUST_ALL_MANAGERS = new TrustManager[] {
new TrustingX509TrustManager()
};
private static final TrustManager[] TRUST_ALL_MANAGERS =
new TrustManager[] {new TrustingX509TrustManager()};
public static final TrustingHostnameVerifier TRUSTING_HOSTNAME_VERIFIER =
new TrustingHostnameVerifier();

Expand Down Expand Up @@ -134,7 +133,10 @@ private void applySslConfiguration(
}
}

private HttpURLConnection openProxiedConnection(@NonNull URL url) throws IOException {
private HttpURLConnection openProxiedConnection(
@NonNull
URL url
) throws IOException {
requireNonNull(url, "URL must not be null");
requireNonNull(trackerConfiguration.getProxyHost(), "Proxy host must not be null");
if (trackerConfiguration.getProxyPort() <= 0) {
Expand Down
9 changes: 2 additions & 7 deletions src/test/java/org/matomo/java/tracking/PiwikTrackerIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import com.github.tomakehurst.wiremock.WireMockServer;
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
import java.net.ConnectException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collections;
Expand Down Expand Up @@ -246,9 +245,7 @@ void createPiwikTrackerWithHostUrlAndProxyHostAndPort() {

assertThatThrownBy(() -> piwikTracker.sendRequest(request))
.isInstanceOf(MatomoException.class)
.hasMessage("Could not send request via GET")
.hasRootCauseInstanceOf(ConnectException.class)
.hasRootCauseMessage("Connection refused (Connection refused)");
.hasMessage("Could not send request via GET");

}

Expand All @@ -263,9 +260,7 @@ void createPiwikTrackerWithHostUrlAndProxyHostAndPortAndTimeout() {

assertThatThrownBy(() -> piwikTracker.sendRequest(request))
.isInstanceOf(MatomoException.class)
.hasMessage("Could not send request via GET")
.hasRootCauseInstanceOf(ConnectException.class)
.hasRootCauseMessage("Connection refused (Connection refused)");
.hasMessage("Could not send request via GET");
}

}

0 comments on commit 99de7cb

Please sign in to comment.