Skip to content

Commit 2e8bf5d

Browse files
committed
chore: add api key auth unit test for index
1 parent f60f886 commit 2e8bf5d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/integration/AddHttpApiKeyAuthPluginTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ private void testInjects(String filename, String extra) {
7171
// Make sure that the middleware file was written and exports the plugin symbol.
7272
assertThat(manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "/middleware/HttpApiKeyAuth/index.ts").get(),
7373
containsString("export const getHttpApiKeyAuthPlugin"));
74+
75+
// Ensure that the middleware was being exported in the index file.
76+
assertThat(manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "/index.ts").get(),
77+
containsString("from \"./middleware/HttpApiKeyAuth\""));
7478
}
7579

7680
private MockManifest generate(String filename)
@@ -124,5 +128,9 @@ private void testDoesNotInject(String filename) {
124128
// Make sure that the middleware file was not written.
125129
assertThat(manifest.hasFile(CodegenUtils.SOURCE_FOLDER + "/middleware/HttpApiKeyAuth/index.ts"),
126130
is(false));
131+
132+
// Ensure that the middleware was not being exported in the index file.
133+
assertThat(manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "/index.ts").get(),
134+
not(containsString("from \"./middleware/HttpApiKeyAuth\"")));
127135
}
128136
}

0 commit comments

Comments
 (0)