File tree Expand file tree Collapse file tree 3 files changed +45
-5
lines changed
main/java/software/amazon/awssdk/services/s3
test/java/software/amazon/awssdk/services/s3/crt Expand file tree Collapse file tree 3 files changed +45
-5
lines changed Original file line number Diff line number Diff line change 19
19
import software .amazon .awssdk .annotations .Immutable ;
20
20
import software .amazon .awssdk .annotations .SdkPublicApi ;
21
21
import software .amazon .awssdk .annotations .ThreadSafe ;
22
+ import software .amazon .awssdk .core .retry .RetryPolicy ;
22
23
import software .amazon .awssdk .services .s3 .S3CrtAsyncClientBuilder ;
23
24
import software .amazon .awssdk .utils .Validate ;
24
25
import software .amazon .awssdk .utils .builder .CopyableBuilder ;
@@ -37,7 +38,7 @@ public final class S3CrtRetryConfiguration implements ToCopyableBuilder<S3CrtRet
37
38
private final Integer numRetries ;
38
39
39
40
private S3CrtRetryConfiguration (DefaultBuilder builder ) {
40
- Validate .isPositiveOrNull (builder .numRetries , "numRetries" );
41
+ Validate .notNull (builder .numRetries , "numRetries" );
41
42
this .numRetries = builder .numRetries ;
42
43
}
43
44
@@ -49,7 +50,7 @@ public static Builder builder() {
49
50
}
50
51
51
52
/**
52
- * Return the amount of time to wait when initially establishing a connection before giving up and timing out .
53
+ * Retrieve the {@link S3CrtRetryConfiguration.Builder#numRetries(Integer)} configured on the builder .
53
54
*/
54
55
public Integer numRetries () {
55
56
return numRetries ;
Original file line number Diff line number Diff line change @@ -105,9 +105,7 @@ private static S3CrtAsyncHttpClient.Builder initializeS3CrtAsyncHttpClient(Defau
105
105
.targetThroughputInGbps (builder .targetThroughputInGbps )
106
106
.partSizeInBytes (builder .minimalPartSizeInBytes )
107
107
.maxConcurrency (builder .maxConcurrency )
108
- .signingRegion (builder .region == null ? null
109
- :
110
- builder .region .id ())
108
+ .signingRegion (builder .region == null ? null : builder .region .id ())
111
109
.endpointOverride (builder .endpointOverride )
112
110
.credentialsProvider (builder .credentialsProvider )
113
111
.readBufferSizeInBytes (builder .readBufferSizeInBytes )
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License").
5
+ * You may not use this file except in compliance with the License.
6
+ * A copy of the License is located at
7
+ *
8
+ * http://aws.amazon.com/apache2.0
9
+ *
10
+ * or in the "license" file accompanying this file. This file is distributed
11
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12
+ * express or implied. See the License for the specific language governing
13
+ * permissions and limitations under the License.
14
+ */
15
+
16
+ package software .amazon .awssdk .services .s3 .crt ;
17
+
18
+ import nl .jqno .equalsverifier .EqualsVerifier ;
19
+ import org .junit .jupiter .api .Test ;
20
+ import static org .assertj .core .api .Assertions .assertThatIllegalArgumentException ;
21
+ import static org .assertj .core .api .Assertions .assertThatNullPointerException ;
22
+
23
+
24
+ public class S3CrtRetryConfigurationTest {
25
+
26
+ @ Test
27
+ void equalsHashcode () {
28
+ EqualsVerifier .forClass (S3CrtRetryConfiguration .class )
29
+ .withRedefinedSuperclass ()
30
+ .verify ();
31
+ }
32
+
33
+ @ Test
34
+ void retryConfigurationWithNoMaxRetriesDefined (){
35
+ assertThatNullPointerException ().isThrownBy (() ->S3CrtRetryConfiguration .builder ().build ())
36
+ .withMessage ("numRetries" );
37
+ }
38
+
39
+
40
+
41
+ }
You can’t perform that action at this time.
0 commit comments