Skip to content

Commit

Permalink
test(codegen): use TypeScriptClientCodegenPlugin (aws#6437)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr committed Sep 4, 2024
1 parent db318cd commit 3601670
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import software.amazon.smithy.model.Model;
import software.amazon.smithy.model.node.Node;
import software.amazon.smithy.typescript.codegen.CodegenUtils;
import software.amazon.smithy.typescript.codegen.TypeScriptCodegenPlugin;
import software.amazon.smithy.typescript.codegen.TypeScriptClientCodegenPlugin;

public class AddAwsAuthPluginTest {
@Test
Expand All @@ -32,7 +32,7 @@ public void awsClient() {
.withMember("useLegacyAuth", Node.from(true))
.build())
.build();
new TypeScriptCodegenPlugin().execute(context);
new TypeScriptClientCodegenPlugin().execute(context);

// Check dependencies
assertThat(manifest.getFileString("package.json").get(),
Expand Down Expand Up @@ -70,7 +70,7 @@ public void sigV4GenericClient() {
.withMember("useLegacyAuth", Node.from(true))
.build())
.build();
new TypeScriptCodegenPlugin().execute(context);
new TypeScriptClientCodegenPlugin().execute(context);

// Check dependencies
assertThat(manifest.getFileString("package.json").get(),
Expand Down Expand Up @@ -108,7 +108,7 @@ public void notSigV4GenericClient() {
.withMember("useLegacyAuth", Node.from(true))
.build())
.build();
new TypeScriptCodegenPlugin().execute(context);
new TypeScriptClientCodegenPlugin().execute(context);

// Check dependencies
assertThat(manifest.getFileString("package.json").get(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import software.amazon.smithy.model.Model;
import software.amazon.smithy.model.node.Node;
import software.amazon.smithy.typescript.codegen.CodegenUtils;
import software.amazon.smithy.typescript.codegen.TypeScriptCodegenPlugin;
import software.amazon.smithy.typescript.codegen.TypeScriptClientCodegenPlugin;
import software.amazon.smithy.typescript.codegen.TypeScriptDependency;

public class AddAwsRuntimeConfigTest {
Expand All @@ -32,7 +32,7 @@ public void awsClient() {
.withMember("packageVersion", Node.from("1.0.0"))
.build())
.build();
new TypeScriptCodegenPlugin().execute(context);
new TypeScriptClientCodegenPlugin().execute(context);

// Check dependencies
assertThat(manifest.getFileString("package.json").get(),
Expand Down Expand Up @@ -79,7 +79,7 @@ public void sigV4GenericClient() {
.withMember("packageVersion", Node.from("1.0.0"))
.build())
.build();
new TypeScriptCodegenPlugin().execute(context);
new TypeScriptClientCodegenPlugin().execute(context);

// Check dependencies
assertThat(manifest.getFileString("package.json").get(),
Expand Down Expand Up @@ -121,7 +121,7 @@ public void notSigV4GenericClient() {
.withMember("packageVersion", Node.from("1.0.0"))
.build())
.build();
new TypeScriptCodegenPlugin().execute(context);
new TypeScriptClientCodegenPlugin().execute(context);

// Check dependencies
assertThat(manifest.getFileString("package.json").get(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import software.amazon.smithy.model.Model;
import software.amazon.smithy.model.node.Node;
import software.amazon.smithy.typescript.codegen.CodegenUtils;
import software.amazon.smithy.typescript.codegen.TypeScriptCodegenPlugin;
import software.amazon.smithy.typescript.codegen.TypeScriptClientCodegenPlugin;

public class AddBuiltinPluginsTest {
@Test
Expand All @@ -31,7 +31,7 @@ public void awsClient() {
.withMember("packageVersion", Node.from("1.0.0"))
.build())
.build();
new TypeScriptCodegenPlugin().execute(context);
new TypeScriptClientCodegenPlugin().execute(context);

// Check the config resolution and middleware plugin
assertThat(manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "/NotSameClient.ts").get(), containsString("resolveRegionConfig"));
Expand Down Expand Up @@ -61,7 +61,7 @@ public void sigV4GenericClient() {
.withMember("packageVersion", Node.from("1.0.0"))
.build())
.build();
new TypeScriptCodegenPlugin().execute(context);
new TypeScriptClientCodegenPlugin().execute(context);

// Check the config resolution and middleware plugin
assertThat(manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "/SsdkExampleSigV4Client.ts").get(), containsString("resolveRegionConfig"));
Expand Down Expand Up @@ -91,7 +91,7 @@ public void notSigV4GenericClient() {
.withMember("packageVersion", Node.from("1.0.0"))
.build())
.build();
new TypeScriptCodegenPlugin().execute(context);
new TypeScriptClientCodegenPlugin().execute(context);

// Check the config resolution and middleware plugin
assertThat(manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "/SsdkExampleClient.ts").get(), not(containsString("resolveRegionConfig")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import software.amazon.smithy.model.Model;
import software.amazon.smithy.model.node.Node;
import software.amazon.smithy.typescript.codegen.CodegenUtils;
import software.amazon.smithy.typescript.codegen.TypeScriptCodegenPlugin;
import software.amazon.smithy.typescript.codegen.TypeScriptClientCodegenPlugin;

public class AddUserAgentDependencyTest {
@Test
Expand All @@ -31,7 +31,7 @@ public void awsClient() {
.withMember("packageVersion", Node.from("1.0.0"))
.build())
.build();
new TypeScriptCodegenPlugin().execute(context);
new TypeScriptClientCodegenPlugin().execute(context);

// Check dependencies
assertThat(manifest.getFileString("package.json").get(),
Expand Down Expand Up @@ -72,7 +72,7 @@ public void genericClient() {
.withMember("packageVersion", Node.from("1.0.0"))
.build())
.build();
new TypeScriptCodegenPlugin().execute(context);
new TypeScriptClientCodegenPlugin().execute(context);

// Check dependencies
assertThat(manifest.getFileString("package.json").get(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import software.amazon.smithy.model.Model;
import software.amazon.smithy.model.node.Node;
import software.amazon.smithy.typescript.codegen.CodegenUtils;
import software.amazon.smithy.typescript.codegen.TypeScriptCodegenPlugin;
import software.amazon.smithy.typescript.codegen.TypeScriptClientCodegenPlugin;
import software.amazon.smithy.typescript.codegen.TypeScriptServerCodegenPlugin;

public class AwsEndpointGeneratorIntegrationTest {
Expand All @@ -31,7 +31,7 @@ public void awsClient() {
.withMember("packageVersion", Node.from("1.0.0"))
.build())
.build();
new TypeScriptCodegenPlugin().execute(context);
new TypeScriptClientCodegenPlugin().execute(context);

assertTrue(manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "/endpoints.ts").isPresent());
}
Expand All @@ -54,7 +54,7 @@ public void genericClient() {
.withMember("packageVersion", Node.from("1.0.0"))
.build())
.build();
new TypeScriptCodegenPlugin().execute(context);
new TypeScriptClientCodegenPlugin().execute(context);

assertFalse(manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "/endpoints.ts").isPresent());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import software.amazon.smithy.model.Model;
import software.amazon.smithy.model.node.Node;
import software.amazon.smithy.typescript.codegen.CodegenUtils;
import software.amazon.smithy.typescript.codegen.TypeScriptCodegenPlugin;
import software.amazon.smithy.typescript.codegen.TypeScriptClientCodegenPlugin;
import software.amazon.smithy.typescript.codegen.TypeScriptServerCodegenPlugin;

public class AwsPackageFixturesGeneratorIntegrationTest {
Expand All @@ -33,7 +33,7 @@ public void awsClient() {
.build())
.build();

new TypeScriptCodegenPlugin().execute(context);
new TypeScriptClientCodegenPlugin().execute(context);

assertTrue(manifest.hasFile("LICENSE"));
assertTrue(manifest.hasFile("README.md"));
Expand Down Expand Up @@ -64,7 +64,7 @@ public void genericClient() {
.build())
.build();

new TypeScriptCodegenPlugin().execute(context);
new TypeScriptClientCodegenPlugin().execute(context);

assertTrue(manifest.hasFile("LICENSE"));
assertTrue(manifest.hasFile(".gitignore"));
Expand Down

0 comments on commit 3601670

Please sign in to comment.