Skip to content

Commit

Permalink
Remove java 9 syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
spmallette committed Jul 18, 2024
1 parent 4675792 commit 984388c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void toSignableRequestNoHostInUri() throws Exception {
// verification
if(signableRequest.contentStreamProvider().isPresent()) {
ContentStreamProvider csp = signableRequest.contentStreamProvider().get();
signableRequestBody = new String(csp.newStream().readAllBytes(), StandardCharsets.UTF_8);
signableRequestBody = IOUtils.toString(csp.newStream(), StandardCharsets.UTF_8);
}
assertEquals("", signableRequestBody);
assertEquals(URI.create(TEST_ENDPOINT_URI).getAuthority(), signableRequest.getUri().getAuthority());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

package com.amazonaws.neptune.auth;

import org.apache.commons.io.IOUtils;
import software.amazon.awssdk.http.SdkHttpFullRequest;
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
import software.amazon.awssdk.http.ContentStreamProvider;
Expand Down Expand Up @@ -110,7 +111,7 @@ public void toSignableRequestHappyGet() throws Exception {

if(signableRequest.contentStreamProvider().isPresent()) {
ContentStreamProvider csp = signableRequest.contentStreamProvider().get();
signableRequestBody = new String(csp.newStream().readAllBytes(), StandardCharsets.UTF_8);
signableRequestBody = IOUtils.toString(csp.newStream(), StandardCharsets.UTF_8);
}
assertEquals("Request content should be blank", "", signableRequestBody);
assertEquals("Unexpected endpoint", URI.create(TEST_FULL_URI),
Expand Down Expand Up @@ -181,7 +182,7 @@ public void toSignableRequestHappyPost() throws Exception {
assertEquals("Non host header should be retained", Arrays.asList(HEADER_TWO_VALUE), headers.get(HEADER_TWO_NAME));
if(signableRequest.contentStreamProvider().isPresent()) {
ContentStreamProvider csp = signableRequest.contentStreamProvider().get();
signableRequestBody = new String(csp.newStream().readAllBytes(), StandardCharsets.UTF_8);
signableRequestBody = IOUtils.toString(csp.newStream(), StandardCharsets.UTF_8);
}
assertEquals("Request content should match", requestBody, signableRequestBody);
assertEquals("Unexpected endpoint", URI.create(TEST_FULL_URI),
Expand Down

0 comments on commit 984388c

Please sign in to comment.