diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/TypeScriptAureliaClientOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/TypeScriptAureliaClientOptionsProvider.java new file mode 100644 index 000000000000..b2dfe8b48bc8 --- /dev/null +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/TypeScriptAureliaClientOptionsProvider.java @@ -0,0 +1,41 @@ +package io.swagger.codegen.options; + +import com.google.common.collect.ImmutableMap; +import io.swagger.codegen.CodegenConstants; +import io.swagger.codegen.languages.TypeScriptAureliaClientCodegen; + +import java.util.Map; + +public class TypeScriptAureliaClientOptionsProvider implements OptionsProvider { + public static final String SORT_PARAMS_VALUE = "false"; + public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; + public static final Boolean SUPPORTS_ES6_VALUE = false; + public static final String MODEL_PROPERTY_NAMING_VALUE = "camelCase"; + private static final String NMP_NAME = "npmName"; + private static final String NMP_VERSION = "1.0.0"; + public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; + + + @Override + public String getLanguage() { + return "typescript-aurelia"; + } + + @Override + public Map createOptions() { + ImmutableMap.Builder builder = new ImmutableMap.Builder(); + return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE) + .put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE) + .put(CodegenConstants.MODEL_PROPERTY_NAMING, MODEL_PROPERTY_NAMING_VALUE) + .put(CodegenConstants.SUPPORTS_ES6, String.valueOf(SUPPORTS_ES6_VALUE)) + .put(TypeScriptAureliaClientCodegen.NPM_NAME, NMP_NAME) + .put(TypeScriptAureliaClientCodegen.NPM_VERSION, NMP_VERSION) + .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) + .build(); + } + + @Override + public boolean isServer() { + return false; + } +} diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/aurelia/TypeScriptAureliaClientOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/aurelia/TypeScriptAureliaClientOptionsTest.java new file mode 100644 index 000000000000..cddc5a6e498f --- /dev/null +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/aurelia/TypeScriptAureliaClientOptionsTest.java @@ -0,0 +1,36 @@ +package io.swagger.codegen.typescript.aurelia; + +import io.swagger.codegen.AbstractOptionsTest; +import io.swagger.codegen.CodegenConfig; +import io.swagger.codegen.languages.TypeScriptFetchClientCodegen; +import io.swagger.codegen.options.TypeScriptAureliaClientOptionsProvider; +import mockit.Expectations; +import mockit.Tested; + +public class TypeScriptAureliaClientOptionsTest extends AbstractOptionsTest { + + @Tested + private TypeScriptFetchClientCodegen clientCodegen; + + public TypeScriptAureliaClientOptionsTest() { + super(new TypeScriptAureliaClientOptionsProvider()); + } + + @Override + protected CodegenConfig getCodegenConfig() { + return clientCodegen; + } + + @SuppressWarnings("unused") + @Override + protected void setExpectations() { + new Expectations(clientCodegen) {{ + clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(TypeScriptAureliaClientOptionsProvider.SORT_PARAMS_VALUE)); + times = 1; + clientCodegen.setModelPropertyNaming(TypeScriptAureliaClientOptionsProvider.MODEL_PROPERTY_NAMING_VALUE); + times = 1; + clientCodegen.setSupportsES6(TypeScriptAureliaClientOptionsProvider.SUPPORTS_ES6_VALUE); + times = 1; + }}; + } +}