From c3c86f0ee81492d4105cfb9e271bf449314810f3 Mon Sep 17 00:00:00 2001 From: "Charandeep S. Matta" Date: Fri, 5 Nov 2021 23:30:52 +0200 Subject: [PATCH] Use 'test' as standard folder for tests (#435) --- .../amazon/smithy/typescript/codegen/CodegenUtils.java | 1 + .../smithy/typescript/codegen/HttpProtocolTestGenerator.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/CodegenUtils.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/CodegenUtils.java index 4f64c6d4ced..82420b69801 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/CodegenUtils.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/CodegenUtils.java @@ -37,6 +37,7 @@ public final class CodegenUtils { public static final String SOURCE_FOLDER = "src"; + public static final String TEST_FOLDER = "test"; private CodegenUtils() {} diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/HttpProtocolTestGenerator.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/HttpProtocolTestGenerator.java index af55e09f933..8566cdfc18f 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/HttpProtocolTestGenerator.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/HttpProtocolTestGenerator.java @@ -409,7 +409,7 @@ private void setupStubService(Symbol operationSymbol, String getHandlerName = "get" + handlerSymbol.getName(); writer.addImport(getHandlerName, null, - Paths.get(".", CodegenUtils.SOURCE_FOLDER, ServerSymbolVisitor.SERVER_FOLDER).toString()); + Paths.get(".", CodegenUtils.TEST_FOLDER, ServerSymbolVisitor.SERVER_FOLDER).toString()); if (!usesDefaultValidation) { writer.addImport("ValidationFailure", "__ValidationFailure", "@aws-smithy/server-common"); @@ -747,7 +747,7 @@ private void writeServerResponseTest(OperationShape operation, HttpResponseTestC + " { return new TestSerializer(); };", serviceOperationsSymbol, serviceSymbol); writer.addImport("serializeFrameworkException", null, - Paths.get(".", CodegenUtils.SOURCE_FOLDER, ProtocolGenerator.PROTOCOLS_FOLDER, + Paths.get(".", CodegenUtils.TEST_FOLDER, ProtocolGenerator.PROTOCOLS_FOLDER, ProtocolGenerator.getSanitizedName(protocolGenerator.getName())).toString()); writer.addImport("ValidationFailure", "__ValidationFailure", "@aws-smithy/server-common"); writer.write("const handler = new $T(service, testMux, serFn, serializeFrameworkException, "