-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Aurelia client options test #5987
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
...egen/src/test/java/io/swagger/codegen/options/TypeScriptAureliaClientOptionsProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<String, String> createOptions() { | ||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>(); | ||
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; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...c/test/java/io/swagger/codegen/typescript/aurelia/TypeScriptAureliaClientOptionsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
}}; | ||
} | ||
} |