Skip to content

Commit 82430d6

Browse files
committed
Updated to the latest service models. Added customization that allows setting the default region used for simple method integration tests.
1 parent cb12a33 commit 82430d6

File tree

18 files changed

+6576
-506
lines changed

18 files changed

+6576
-506
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"category": "AWS SDK for Java v2",
3+
"type": "feature",
4+
"description": "Updated to the latest service models."
5+
}

aws-sdk-java/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,11 @@
571571
<artifactId>transfer</artifactId>
572572
<version>${awsjavasdk.version}</version>
573573
</dependency>
574+
<dependency>
575+
<groupId>software.amazon.awssdk</groupId>
576+
<artifactId>globalaccelerator</artifactId>
577+
<version>${awsjavasdk.version}</version>
578+
</dependency>
574579
</dependencies>
575580
<build>
576581
<finalName>${project.artifactId}-${project.version}</finalName>

codegen/src/main/java/software/amazon/awssdk/codegen/model/config/customization/CustomizationConfig.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ public class CustomizationConfig {
104104
*/
105105
private List<String> verifiedSimpleMethods = new ArrayList<>();
106106

107+
/**
108+
* If a service isn't in the endpoints.json, the region that should be used for simple method integration tests.
109+
*/
110+
private String defaultSimpleMethodTestRegion;
111+
107112
private List<String> deprecatedOperations = new ArrayList<>();
108113

109114
private List<String> deprecatedShapes = new ArrayList<>();
@@ -270,6 +275,14 @@ public void setVerifiedSimpleMethods(List<String> verifiedSimpleMethods) {
270275
this.verifiedSimpleMethods = verifiedSimpleMethods;
271276
}
272277

278+
public String getDefaultSimpleMethodTestRegion() {
279+
return defaultSimpleMethodTestRegion;
280+
}
281+
282+
public void setDefaultSimpleMethodTestRegion(String defaultSimpleMethodTestRegion) {
283+
this.defaultSimpleMethodTestRegion = defaultSimpleMethodTestRegion;
284+
}
285+
273286
public List<String> getDeprecatedOperations() {
274287
return deprecatedOperations;
275288
}

codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/ClientSimpleMethodsIntegrationTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.squareup.javapoet.FieldSpec;
2020
import com.squareup.javapoet.MethodSpec;
2121
import com.squareup.javapoet.TypeSpec;
22+
import java.util.Optional;
2223
import javax.lang.model.element.Modifier;
2324
import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel;
2425
import software.amazon.awssdk.codegen.model.intermediate.OperationModel;
@@ -66,13 +67,15 @@ public ClassName className() {
6667
* be used.
6768
*/
6869
private MethodSpec setup() {
70+
String defaultRegion = Optional.ofNullable(model.getCustomizationConfig().getDefaultSimpleMethodTestRegion())
71+
.orElse("US_EAST_1");
6972
ClassName beforeClass = ClassName.get("org.junit", "BeforeClass");
7073
ClassName interfaceClass = poetExtensions.getClientClass(model.getMetadata().getSyncInterface());
7174
return MethodSpec.methodBuilder("setup")
7275
.addAnnotation(beforeClass)
7376
.addModifiers(Modifier.PUBLIC, Modifier.STATIC)
7477
.beginControlFlow("if ($T.serviceMetadata().regions().isEmpty())", interfaceClass)
75-
.addStatement("client = $T.builder().region($T.US_EAST_1).build()", interfaceClass, Region.class)
78+
.addStatement("client = $T.builder().region($T.$L).build()", interfaceClass, Region.class, defaultRegion)
7679
.endControlFlow()
7780
.beginControlFlow("else if ($T.serviceMetadata().regions().contains($T.AWS_GLOBAL))",
7881
interfaceClass,

services/ec2/src/main/resources/codegen-resources/service-2.json

Lines changed: 2032 additions & 174 deletions
Large diffs are not rendered by default.

services/globalaccelerator/pom.xml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
~ Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License").
6+
~ You may not use this file except in compliance with the License.
7+
~ A copy of the License is located at
8+
~
9+
~ http://aws.amazon.com/apache2.0
10+
~
11+
~ or in the "license" file accompanying this file. This file is distributed
12+
~ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13+
~ express or implied. See the License for the specific language governing
14+
~ permissions and limitations under the License.
15+
-->
16+
17+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
18+
xmlns="http://maven.apache.org/POM/4.0.0"
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
20+
<modelVersion>4.0.0</modelVersion>
21+
<parent>
22+
<groupId>software.amazon.awssdk</groupId>
23+
<artifactId>services</artifactId>
24+
<version>2.1.1-SNAPSHOT</version>
25+
</parent>
26+
<artifactId>globalaccelerator</artifactId>
27+
<name>AWS Java SDK :: Services :: Global Accelerator</name>
28+
<description>The AWS Java SDK for Global Accelerator module holds the client classes that are used for
29+
communicating with Global Accelerator.
30+
</description>
31+
<url>https://aws.amazon.com/sdkforjava</url>
32+
<build>
33+
<plugins>
34+
<plugin>
35+
<groupId>org.apache.maven.plugins</groupId>
36+
<artifactId>maven-jar-plugin</artifactId>
37+
<configuration>
38+
<archive>
39+
<manifestEntries>
40+
<Automatic-Module-Name>software.amazon.awssdk.services.globalaccelerator</Automatic-Module-Name>
41+
</manifestEntries>
42+
</archive>
43+
</configuration>
44+
</plugin>
45+
</plugins>
46+
</build>
47+
48+
<dependencies>
49+
<dependency>
50+
<groupId>software.amazon.awssdk</groupId>
51+
<artifactId>protocol-core</artifactId>
52+
<version>${awsjavasdk.version}</version>
53+
</dependency>
54+
<dependency>
55+
<groupId>software.amazon.awssdk</groupId>
56+
<artifactId>aws-json-protocol</artifactId>
57+
<version>${awsjavasdk.version}</version>
58+
</dependency>
59+
</dependencies>
60+
</project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"defaultSimpleMethodTestRegion": "US_WEST_2",
3+
"blacklistedSimpleMethods" : [
4+
"describeAcceleratorAttributes"
5+
]
6+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"pagination": {
3+
}
4+
}

0 commit comments

Comments
 (0)