Skip to content

Commit

Permalink
Remove usage of deprecated methods
Browse files Browse the repository at this point in the history
Replaces usage of deprecated methods in newly created tests to prevent
them from breaking if the deprecated method is removed. Removes unused
variable.
  • Loading branch information
acm19 committed Nov 19, 2024
1 parent 24be4d0 commit a26c6cb
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.apache.hc.client5.http.impl.classic.HttpClients;
import org.apache.hc.core5.http.ContentType;
import org.apache.hc.core5.http.HttpHeaders;
import org.apache.hc.core5.http.impl.BasicEntityDetails;
import org.apache.hc.core5.http.io.entity.BasicHttpEntity;
import org.apache.hc.core5.http.io.entity.ByteArrayEntity;
import org.apache.hc.core5.http.io.entity.StringEntity;
Expand All @@ -37,7 +36,6 @@
import software.amazon.awssdk.regions.Region;

class AwsRequestSigningApacheV5InterceptorTest {
private static final BasicEntityDetails ENTITY_DETAILS = new BasicEntityDetails(0, ContentType.TEXT_XML);
private MockWebServer server;
private CloseableHttpClient client;

Expand Down Expand Up @@ -69,7 +67,7 @@ void signGetRequest() throws Exception {
HttpGet request = new HttpGet(server.url("/query?a=b").toString());
request.addHeader("foo", "bar");

client.execute(request);
client.execute(request, response -> "ignored");
RecordedRequest recorded = server.takeRequest();

assertEquals("bar", recorded.getHeader("foo"));
Expand All @@ -89,7 +87,7 @@ void signPostRequest() throws Exception {
payloadData.length, ContentType.TEXT_XML);
request.setEntity(httpEntity);

client.execute(request);
client.execute(request, response -> "ignored");
RecordedRequest recorded = server.takeRequest();

assertEquals("bar", recorded.getHeader("foo"));
Expand All @@ -108,7 +106,7 @@ void testEncodedUriSigner() throws Exception {
request.setEntity(new StringEntity(data));
request.addHeader("foo", "bar");

client.execute(request);
client.execute(request, response -> "ignored");
RecordedRequest recorded = server.takeRequest();

assertEquals("bar", recorded.getHeader("foo"));
Expand All @@ -131,7 +129,7 @@ void testGzipCompressedContent() throws Exception {
request.setHeader(HttpHeaders.CONTENT_ENCODING, "gzip");
request.setEntity(entity);

client.execute(request);
client.execute(request, response -> "ignored");
RecordedRequest recorded = server.takeRequest();

assertEquals("wuzzle", recorded.getHeader("Signature"));
Expand Down

0 comments on commit a26c6cb

Please sign in to comment.