Skip to content

Commit 8a92319

Browse files
committed
Update codegen test cases after Skip rules based endpoints for most services
1 parent fb41541 commit 8a92319

8 files changed

+8
-97
lines changed

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/builder/test-async-client-builder-class.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import software.amazon.awssdk.annotations.SdkInternalApi;
55
import software.amazon.awssdk.auth.token.credentials.SdkTokenProvider;
66
import software.amazon.awssdk.awscore.client.config.AwsClientOption;
7-
import software.amazon.awssdk.core.client.config.SdkClientOption;
8-
import software.amazon.awssdk.services.json.endpoints.JsonEndpointProvider;
97

108
/**
119
* Internal implementation of {@link JsonAsyncClientBuilder}.
@@ -14,12 +12,6 @@
1412
@SdkInternalApi
1513
final class DefaultJsonAsyncClientBuilder extends DefaultJsonBaseClientBuilder<JsonAsyncClientBuilder, JsonAsyncClient> implements
1614
JsonAsyncClientBuilder {
17-
@Override
18-
public DefaultJsonAsyncClientBuilder endpointProvider(JsonEndpointProvider endpointProvider) {
19-
clientConfiguration.option(SdkClientOption.ENDPOINT_PROVIDER, endpointProvider);
20-
return this;
21-
}
22-
2315
@Override
2416
public DefaultJsonAsyncClientBuilder tokenProvider(SdkTokenProvider tokenProvider) {
2517
clientConfiguration.option(AwsClientOption.TOKEN_PROVIDER, tokenProvider);

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/builder/test-bearer-auth-client-builder-class.java

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
import software.amazon.awssdk.core.interceptor.ClasspathInterceptorChainFactory;
1616
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
1717
import software.amazon.awssdk.core.signer.Signer;
18-
import software.amazon.awssdk.services.json.endpoints.JsonEndpointProvider;
19-
import software.amazon.awssdk.services.json.endpoints.internal.JsonEndpointAuthSchemeInterceptor;
20-
import software.amazon.awssdk.services.json.endpoints.internal.JsonRequestSetEndpointInterceptor;
21-
import software.amazon.awssdk.services.json.endpoints.internal.JsonResolveEndpointInterceptor;
2218
import software.amazon.awssdk.utils.CollectionUtils;
2319

2420
/**
@@ -39,18 +35,14 @@ protected final String serviceName() {
3935

4036
@Override
4137
protected final SdkClientConfiguration mergeServiceDefaults(SdkClientConfiguration config) {
42-
return config.merge(c -> c.option(SdkClientOption.ENDPOINT_PROVIDER, defaultEndpointProvider())
43-
.option(SdkClientOption.CRC32_FROM_COMPRESSED_DATA_ENABLED, false)
38+
return config.merge(c -> c.option(SdkClientOption.CRC32_FROM_COMPRESSED_DATA_ENABLED, false)
4439
.option(AwsClientOption.TOKEN_PROVIDER, defaultTokenProvider())
4540
.option(SdkAdvancedClientOption.TOKEN_SIGNER, defaultTokenSigner()));
4641
}
4742

4843
@Override
4944
protected final SdkClientConfiguration finalizeServiceConfiguration(SdkClientConfiguration config) {
5045
List<ExecutionInterceptor> endpointInterceptors = new ArrayList<>();
51-
endpointInterceptors.add(new JsonResolveEndpointInterceptor());
52-
endpointInterceptors.add(new JsonEndpointAuthSchemeInterceptor());
53-
endpointInterceptors.add(new JsonRequestSetEndpointInterceptor());
5446
ClasspathInterceptorChainFactory interceptorFactory = new ClasspathInterceptorChainFactory();
5547
List<ExecutionInterceptor> interceptors = interceptorFactory
5648
.getInterceptors("software/amazon/awssdk/services/json/execution.interceptors");
@@ -66,15 +58,11 @@ protected final String signingName() {
6658
return "json-service";
6759
}
6860

69-
private JsonEndpointProvider defaultEndpointProvider() {
70-
return JsonEndpointProvider.defaultProvider();
71-
}
72-
7361
private SdkTokenProvider defaultTokenProvider() {
7462
return DefaultAwsTokenProvider.create();
7563
}
7664

7765
private Signer defaultTokenSigner() {
7866
return BearerTokenSigner.create();
7967
}
80-
}
68+
}

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/builder/test-bearer-auth-client-builder-interface.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,13 @@
33
import software.amazon.awssdk.annotations.Generated;
44
import software.amazon.awssdk.auth.token.credentials.SdkTokenProvider;
55
import software.amazon.awssdk.awscore.client.builder.AwsClientBuilder;
6-
import software.amazon.awssdk.services.json.endpoints.JsonEndpointProvider;
76

87
/**
98
* This includes configuration specific to Json Service that is supported by both {@link JsonClientBuilder} and
109
* {@link JsonAsyncClientBuilder}.
1110
*/
1211
@Generated("software.amazon.awssdk:codegen")
1312
public interface JsonBaseClientBuilder<B extends JsonBaseClientBuilder<B, C>, C> extends AwsClientBuilder<B, C> {
14-
/**
15-
* Set the {@link JsonEndpointProvider} implementation that will be used by the client to determine the endpoint for
16-
* each request. This is optional; if none is provided a default implementation will be used the SDK.
17-
*/
18-
B endpointProvider(JsonEndpointProvider endpointProvider);
19-
2013
/**
2114
* Set the token provider to use for bearer token authorization. This is optional, if none is provided, the SDK will
2215
* use {@link software.amazon.awssdk.auth.token.credentials.aws.DefaultAwsTokenProvider}.
@@ -29,4 +22,4 @@ public interface JsonBaseClientBuilder<B extends JsonBaseClientBuilder<B, C>, C>
2922
* default it is {@link software.amazon.awssdk.auth.token.signer.aws.BearerTokenSigner}.
3023
*/
3124
B tokenProvider(SdkTokenProvider tokenProvider);
32-
}
25+
}

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/builder/test-client-builder-class.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
2020
import software.amazon.awssdk.core.signer.Signer;
2121
import software.amazon.awssdk.services.json.endpoints.JsonClientContextParams;
22-
import software.amazon.awssdk.services.json.endpoints.JsonEndpointProvider;
23-
import software.amazon.awssdk.services.json.endpoints.internal.JsonEndpointAuthSchemeInterceptor;
24-
import software.amazon.awssdk.services.json.endpoints.internal.JsonRequestSetEndpointInterceptor;
25-
import software.amazon.awssdk.services.json.endpoints.internal.JsonResolveEndpointInterceptor;
2622
import software.amazon.awssdk.utils.AttributeMap;
2723
import software.amazon.awssdk.utils.CollectionUtils;
2824
import software.amazon.awssdk.utils.Validate;
@@ -45,8 +41,7 @@ protected final String serviceName() {
4541

4642
@Override
4743
protected final SdkClientConfiguration mergeServiceDefaults(SdkClientConfiguration config) {
48-
return config.merge(c -> c.option(SdkClientOption.ENDPOINT_PROVIDER, defaultEndpointProvider())
49-
.option(SdkAdvancedClientOption.SIGNER, defaultSigner())
44+
return config.merge(c -> c.option(SdkAdvancedClientOption.SIGNER, defaultSigner())
5045
.option(SdkClientOption.CRC32_FROM_COMPRESSED_DATA_ENABLED, false)
5146
.option(SdkClientOption.SERVICE_CONFIGURATION, ServiceConfiguration.builder().build())
5247
.option(AwsClientOption.TOKEN_PROVIDER, defaultTokenProvider())
@@ -56,9 +51,6 @@ protected final SdkClientConfiguration mergeServiceDefaults(SdkClientConfigurati
5651
@Override
5752
protected final SdkClientConfiguration finalizeServiceConfiguration(SdkClientConfiguration config) {
5853
List<ExecutionInterceptor> endpointInterceptors = new ArrayList<>();
59-
endpointInterceptors.add(new JsonResolveEndpointInterceptor());
60-
endpointInterceptors.add(new JsonEndpointAuthSchemeInterceptor());
61-
endpointInterceptors.add(new JsonRequestSetEndpointInterceptor());
6254
ClasspathInterceptorChainFactory interceptorFactory = new ClasspathInterceptorChainFactory();
6355
List<ExecutionInterceptor> interceptors = interceptorFactory
6456
.getInterceptors("software/amazon/awssdk/services/json/execution.interceptors");
@@ -137,10 +129,6 @@ protected final String signingName() {
137129
return "json-service";
138130
}
139131

140-
private JsonEndpointProvider defaultEndpointProvider() {
141-
return JsonEndpointProvider.defaultProvider();
142-
}
143-
144132
public B serviceConfiguration(ServiceConfiguration serviceConfiguration) {
145133
clientConfiguration.option(SdkClientOption.SERVICE_CONFIGURATION, serviceConfiguration);
146134
return thisBuilder();

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/builder/test-client-builder-interface.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import software.amazon.awssdk.annotations.Generated;
55
import software.amazon.awssdk.auth.token.credentials.SdkTokenProvider;
66
import software.amazon.awssdk.awscore.client.builder.AwsClientBuilder;
7-
import software.amazon.awssdk.services.json.endpoints.JsonEndpointProvider;
87

98
/**
109
* This includes configuration specific to Json Service that is supported by both {@link JsonClientBuilder} and
@@ -18,12 +17,6 @@ default B serviceConfiguration(Consumer<ServiceConfiguration.Builder> serviceCon
1817
return serviceConfiguration(ServiceConfiguration.builder().applyMutation(serviceConfiguration).build());
1918
}
2019

21-
/**
22-
* Set the {@link JsonEndpointProvider} implementation that will be used by the client to determine the endpoint for
23-
* each request. This is optional; if none is provided a default implementation will be used the SDK.
24-
*/
25-
B endpointProvider(JsonEndpointProvider endpointProvider);
26-
2720
/**
2821
* Set the token provider to use for bearer token authorization. This is optional, if none is provided, the SDK will
2922
* use {@link software.amazon.awssdk.auth.token.credentials.aws.DefaultAwsTokenProvider}.

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/builder/test-client-builder-internal-defaults-class.java

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
1414
import software.amazon.awssdk.core.retry.RetryMode;
1515
import software.amazon.awssdk.core.signer.Signer;
16-
import software.amazon.awssdk.services.json.endpoints.JsonEndpointProvider;
17-
import software.amazon.awssdk.services.json.endpoints.internal.JsonEndpointAuthSchemeInterceptor;
18-
import software.amazon.awssdk.services.json.endpoints.internal.JsonRequestSetEndpointInterceptor;
19-
import software.amazon.awssdk.services.json.endpoints.internal.JsonResolveEndpointInterceptor;
2016
import software.amazon.awssdk.utils.CollectionUtils;
2117

2218
/**
@@ -37,9 +33,8 @@ protected final String serviceName() {
3733

3834
@Override
3935
protected final SdkClientConfiguration mergeServiceDefaults(SdkClientConfiguration config) {
40-
return config.merge(c -> c.option(SdkClientOption.ENDPOINT_PROVIDER, defaultEndpointProvider())
41-
.option(SdkAdvancedClientOption.SIGNER, defaultSigner())
42-
.option(SdkClientOption.CRC32_FROM_COMPRESSED_DATA_ENABLED, false));
36+
return config.merge(c -> c.option(SdkAdvancedClientOption.SIGNER, defaultSigner()).option(
37+
SdkClientOption.CRC32_FROM_COMPRESSED_DATA_ENABLED, false));
4338
}
4439

4540
@Override
@@ -53,9 +48,6 @@ protected final SdkClientConfiguration mergeInternalDefaults(SdkClientConfigurat
5348
@Override
5449
protected final SdkClientConfiguration finalizeServiceConfiguration(SdkClientConfiguration config) {
5550
List<ExecutionInterceptor> endpointInterceptors = new ArrayList<>();
56-
endpointInterceptors.add(new JsonResolveEndpointInterceptor());
57-
endpointInterceptors.add(new JsonEndpointAuthSchemeInterceptor());
58-
endpointInterceptors.add(new JsonRequestSetEndpointInterceptor());
5951
ClasspathInterceptorChainFactory interceptorFactory = new ClasspathInterceptorChainFactory();
6052
List<ExecutionInterceptor> interceptors = interceptorFactory
6153
.getInterceptors("software/amazon/awssdk/services/json/execution.interceptors");
@@ -74,8 +66,4 @@ private Signer defaultSigner() {
7466
protected final String signingName() {
7567
return "json-service";
7668
}
77-
78-
private JsonEndpointProvider defaultEndpointProvider() {
79-
return JsonEndpointProvider.defaultProvider();
80-
}
8169
}

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/builder/test-query-client-builder-class.java

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@
1717
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
1818
import software.amazon.awssdk.core.signer.Signer;
1919
import software.amazon.awssdk.protocols.query.interceptor.QueryParametersToBodyInterceptor;
20-
import software.amazon.awssdk.services.query.endpoints.QueryClientContextParams;
21-
import software.amazon.awssdk.services.query.endpoints.QueryEndpointProvider;
22-
import software.amazon.awssdk.services.query.endpoints.internal.QueryEndpointAuthSchemeInterceptor;
23-
import software.amazon.awssdk.services.query.endpoints.internal.QueryRequestSetEndpointInterceptor;
24-
import software.amazon.awssdk.services.query.endpoints.internal.QueryResolveEndpointInterceptor;
2520
import software.amazon.awssdk.utils.CollectionUtils;
2621

2722
/**
@@ -42,8 +37,7 @@ protected final String serviceName() {
4237

4338
@Override
4439
protected final SdkClientConfiguration mergeServiceDefaults(SdkClientConfiguration config) {
45-
return config.merge(c -> c.option(SdkClientOption.ENDPOINT_PROVIDER, defaultEndpointProvider())
46-
.option(SdkAdvancedClientOption.SIGNER, defaultSigner())
40+
return config.merge(c -> c.option(SdkAdvancedClientOption.SIGNER, defaultSigner())
4741
.option(SdkClientOption.CRC32_FROM_COMPRESSED_DATA_ENABLED, false)
4842
.option(AwsClientOption.TOKEN_PROVIDER, defaultTokenProvider())
4943
.option(SdkAdvancedClientOption.TOKEN_SIGNER, defaultTokenSigner()));
@@ -52,9 +46,6 @@ protected final SdkClientConfiguration mergeServiceDefaults(SdkClientConfigurati
5246
@Override
5347
protected final SdkClientConfiguration finalizeServiceConfiguration(SdkClientConfiguration config) {
5448
List<ExecutionInterceptor> endpointInterceptors = new ArrayList<>();
55-
endpointInterceptors.add(new QueryResolveEndpointInterceptor());
56-
endpointInterceptors.add(new QueryEndpointAuthSchemeInterceptor());
57-
endpointInterceptors.add(new QueryRequestSetEndpointInterceptor());
5849
ClasspathInterceptorChainFactory interceptorFactory = new ClasspathInterceptorChainFactory();
5950
List<ExecutionInterceptor> interceptors = interceptorFactory
6051
.getInterceptors("software/amazon/awssdk/services/query/execution.interceptors");
@@ -76,25 +67,11 @@ protected final String signingName() {
7667
return "query-service";
7768
}
7869

79-
private QueryEndpointProvider defaultEndpointProvider() {
80-
return QueryEndpointProvider.defaultProvider();
81-
}
82-
83-
public B booleanContextParam(Boolean booleanContextParam) {
84-
clientContextParams.put(QueryClientContextParams.BOOLEAN_CONTEXT_PARAM, booleanContextParam);
85-
return thisBuilder();
86-
}
87-
88-
public B stringContextParam(String stringContextParam) {
89-
clientContextParams.put(QueryClientContextParams.STRING_CONTEXT_PARAM, stringContextParam);
90-
return thisBuilder();
91-
}
92-
9370
private SdkTokenProvider defaultTokenProvider() {
9471
return DefaultAwsTokenProvider.create();
9572
}
9673

9774
private Signer defaultTokenSigner() {
9875
return BearerTokenSigner.create();
9976
}
100-
}
77+
}

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/builder/test-sync-client-builder-class.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import software.amazon.awssdk.annotations.SdkInternalApi;
55
import software.amazon.awssdk.auth.token.credentials.SdkTokenProvider;
66
import software.amazon.awssdk.awscore.client.config.AwsClientOption;
7-
import software.amazon.awssdk.core.client.config.SdkClientOption;
8-
import software.amazon.awssdk.services.json.endpoints.JsonEndpointProvider;
97

108
/**
119
* Internal implementation of {@link JsonClientBuilder}.
@@ -14,12 +12,6 @@
1412
@SdkInternalApi
1513
final class DefaultJsonClientBuilder extends DefaultJsonBaseClientBuilder<JsonClientBuilder, JsonClient> implements
1614
JsonClientBuilder {
17-
@Override
18-
public DefaultJsonClientBuilder endpointProvider(JsonEndpointProvider endpointProvider) {
19-
clientConfiguration.option(SdkClientOption.ENDPOINT_PROVIDER, endpointProvider);
20-
return this;
21-
}
22-
2315
@Override
2416
public DefaultJsonClientBuilder tokenProvider(SdkTokenProvider tokenProvider) {
2517
clientConfiguration.option(AwsClientOption.TOKEN_PROVIDER, tokenProvider);

0 commit comments

Comments
 (0)