File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
main/java/software/amazon/awssdk/core/client/builder
test/java/software/amazon/awssdk/core/client/builder Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -284,7 +284,8 @@ private Executor resolveAsyncFutureCompletionExecutor(SdkClientConfiguration con
284
284
}
285
285
286
286
/**
287
- * Finalize which scheduled executor service will be used for retries in the created client.
287
+ * Finalize the internal SDK scheduled executor service that is used for scheduling tasks such
288
+ * as async retry attempts and timeout task.
288
289
*/
289
290
private ScheduledExecutorService resolveScheduledExecutorService () {
290
291
return Executors .newScheduledThreadPool (5 , new ThreadFactoryBuilder ()
@@ -301,6 +302,8 @@ private List<ExecutionInterceptor> resolveExecutionInterceptors(SdkClientConfigu
301
302
302
303
@ Override
303
304
public final B endpointOverride (URI endpointOverride ) {
305
+ Validate .paramNotNull (endpointOverride , "endpointOverride" );
306
+ Validate .paramNotNull (endpointOverride .getScheme (), "The URI scheme of endpointOverride" );
304
307
clientConfiguration .option (SdkClientOption .ENDPOINT , endpointOverride );
305
308
return thisBuilder ();
306
309
}
Original file line number Diff line number Diff line change 16
16
package software .amazon .awssdk .core .client .builder ;
17
17
18
18
import static org .assertj .core .api .Assertions .assertThat ;
19
+ import static org .assertj .core .api .Assertions .assertThatThrownBy ;
19
20
import static org .mockito .Matchers .any ;
20
21
import static org .mockito .Mockito .mock ;
21
22
import static org .mockito .Mockito .never ;
@@ -90,6 +91,13 @@ public void buildWithEndpointShouldHaveCorrectEndpointAndSigningRegion() {
90
91
assertThat (client .clientConfiguration .option (SdkClientOption .ENDPOINT )).isEqualTo (ENDPOINT );
91
92
}
92
93
94
+ @ Test
95
+ public void buildWithEndpointWithoutScheme_shouldThrowException () {
96
+ assertThatThrownBy (() -> testClientBuilder ().endpointOverride (URI .create ("localhost" )).build ())
97
+ .hasMessageContaining ("The URI scheme of endpointOverride must not be null" );
98
+
99
+ }
100
+
93
101
@ Test
94
102
public void noClientProvided_DefaultHttpClientIsManagedBySdk () {
95
103
TestClient client = testClientBuilder ().build ();
You can’t perform that action at this time.
0 commit comments