Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import static com.github.tomakehurst.wiremock.client.WireMock.put;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
import static org.assertj.core.api.Assertions.assertThat;

Check warning on line 23 in services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/multipart/MultipartClientChecksumTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this unused import 'org.assertj.core.api.Assertions.assertThat'.

See more on https://sonarcloud.io/project/issues?id=aws_aws-sdk-java-v2&issues=AZ23DSnnqg995FU6Fcgh&open=AZ23DSnnqg995FU6Fcgh&pullRequest=6891

import com.github.tomakehurst.wiremock.WireMockServer;
import java.io.IOException;
Expand All @@ -39,8 +39,8 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.params.ParameterizedTest;

Check warning on line 42 in services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/multipart/MultipartClientChecksumTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this unused import 'org.junit.jupiter.params.ParameterizedTest'.

See more on https://sonarcloud.io/project/issues?id=aws_aws-sdk-java-v2&issues=AZ23DSnnqg995FU6Fcgi&open=AZ23DSnnqg995FU6Fcgi&pullRequest=6891
import org.junit.jupiter.params.provider.MethodSource;

Check warning on line 43 in services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/multipart/MultipartClientChecksumTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this unused import 'org.junit.jupiter.params.provider.MethodSource'.

See more on https://sonarcloud.io/project/issues?id=aws_aws-sdk-java-v2&issues=AZ23DSnnqg995FU6Fcgj&open=AZ23DSnnqg995FU6Fcgj&pullRequest=6891
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.core.interceptor.Context;
Expand All @@ -55,7 +55,7 @@
import software.amazon.awssdk.services.s3.model.PutObjectRequest;
import software.amazon.awssdk.services.s3.model.UploadPartRequest;

class MultipartClientChecksumTest {

Check failure on line 58 in services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/multipart/MultipartClientChecksumTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add some tests to this class.

See more on https://sonarcloud.io/project/issues?id=aws_aws-sdk-java-v2&issues=AZ23DSnnqg995FU6Fcgc&open=AZ23DSnnqg995FU6Fcgc&pullRequest=6891
private static final WireMockServer wireMock = new WireMockServer(wireMockConfig().dynamicPort());
private static final long FILE_SIZE = 16 * 1024 * 1024L;
private static Path testFile;
Expand Down Expand Up @@ -100,9 +100,10 @@
wireMock.stop();
}

@ParameterizedTest
// TODO - re-enable after S3 feature release

Check warning on line 103 in services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/multipart/MultipartClientChecksumTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this TODO comment.

See more on https://sonarcloud.io/project/issues?id=aws_aws-sdk-java-v2&issues=AZ23DSnnqg995FU6Fcgg&open=AZ23DSnnqg995FU6Fcgg&pullRequest=6891
/*@ParameterizedTest
@MethodSource("checksumAlgorithmParams")
public void multipartUpload_withChecksumAlgorithmAndNoChecksumValueProvided_shouldNotAddChecksumType(ChecksumAlgorithm checksumAlgorithm) {

Check warning on line 106 in services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/multipart/MultipartClientChecksumTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=aws_aws-sdk-java-v2&issues=AZ23DSnnqg995FU6Fcgf&open=AZ23DSnnqg995FU6Fcgf&pullRequest=6891
stubSuccessfulResponses();
PutObjectRequest putObjectRequest = putObjectRequestBuilder().checksumAlgorithm(checksumAlgorithm).build();

Expand All @@ -113,7 +114,7 @@
assertThat(checksumCapturingInterceptor.createMpuChecksumType).isNull();
assertThat(checksumCapturingInterceptor.completeMpuChecksumType).isNull();
assertThat(checksumCapturingInterceptor.completeMpuMpObjectSize).isEqualTo(FILE_SIZE);
}
}*/

// TODO - re-enable after S3 feature release
/*@ParameterizedTest
Expand Down Expand Up @@ -159,11 +160,11 @@
assertThat(checksumCapturingInterceptor.completeMpuMpObjectSize).isEqualTo(FILE_SIZE);
}*/

private PutObjectRequest.Builder putObjectRequestBuilder() {

Check warning on line 163 in services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/multipart/MultipartClientChecksumTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this unused private "putObjectRequestBuilder" method.

See more on https://sonarcloud.io/project/issues?id=aws_aws-sdk-java-v2&issues=AZ23DSnnqg995FU6Fcgd&open=AZ23DSnnqg995FU6Fcgd&pullRequest=6891
return PutObjectRequest.builder().bucket("bucket").key("key");
}

private void stubSuccessfulResponses() {

Check warning on line 167 in services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/multipart/MultipartClientChecksumTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this unused private "stubSuccessfulResponses" method.

See more on https://sonarcloud.io/project/issues?id=aws_aws-sdk-java-v2&issues=AZ23DSnnqg995FU6Fcge&open=AZ23DSnnqg995FU6Fcge&pullRequest=6891
stubCreateMpuSuccessfulResponse();
stubSuccessfulUploadParts(2); // 16 MB File Size / 8 MB Default Part Size
stubCompleteMpuSuccessfulResponse();
Expand Down
Loading