|
29 | 29 | import software.amazon.smithy.typescript.codegen.CodegenUtils;
|
30 | 30 | import software.amazon.smithy.typescript.codegen.TypeScriptClientCodegenPlugin;
|
31 | 31 |
|
32 |
| -@Disabled("WIP") |
33 | 32 | public class AddHttpApiKeyAuthPluginTest {
|
34 | 33 | @Test
|
35 | 34 | public void httpApiKeyAuthClientOnService() {
|
@@ -63,13 +62,13 @@ private void testInjects(String filename, String extra) {
|
63 | 62 | assertThat(manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "/commands/GetFooCommand.ts").get(),
|
64 | 63 | containsString("from \"../middleware/HttpApiKeyAuth\""));
|
65 | 64 | assertThat(manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "/commands/GetFooCommand.ts").get(),
|
66 |
| - containsString("this.middlewareStack.use(getHttpApiKeyAuthPlugin(configuration" + extra + "));")); |
| 65 | + containsString("getHttpApiKeyAuthPlugin(config" + extra + ")")); |
67 | 66 |
|
68 | 67 | // Ensure that the GetBar operation does not import the middleware or use it.
|
69 | 68 | assertThat(manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "/commands/GetBarCommand.ts").get(),
|
70 | 69 | not(containsString("from \"../middleware/HttpApiKeyAuth\"")));
|
71 | 70 | assertThat(manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "/commands/GetBarCommand.ts").get(),
|
72 |
| - not(containsString("this.middlewareStack.use(getHttpApiKeyAuthPlugin"))); |
| 71 | + not(containsString("getHttpApiKeyAuthPlugin"))); |
73 | 72 |
|
74 | 73 | // Make sure that the middleware file was written and exports the plugin symbol.
|
75 | 74 | assertThat(manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "/middleware/HttpApiKeyAuth/index.ts").get(),
|
@@ -126,7 +125,7 @@ private void testDoesNotInject(String filename) {
|
126 | 125 | assertThat(manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "/commands/GetFooCommand.ts").get(),
|
127 | 126 | not(containsString("from \"../middleware/HttpApiKeyAuth\"")));
|
128 | 127 | assertThat(manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "/commands/GetFooCommand.ts").get(),
|
129 |
| - not(containsString("this.middlewareStack.use(getHttpApiKeyAuthPlugin(configuration"))); |
| 128 | + not(containsString("getHttpApiKeyAuthPlugin(configuration"))); |
130 | 129 |
|
131 | 130 | // Make sure that the middleware file was not written.
|
132 | 131 | assertThat(manifest.hasFile(CodegenUtils.SOURCE_FOLDER + "/middleware/HttpApiKeyAuth/index.ts"),
|
|
0 commit comments