forked from loafle/openapi-generator-original
processOptions tests have been added for Android, Ruby, nodeJS, php, python, csharp, CsharpDotNet2, dart, flash
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
package io.swagger.codegen.android;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.AndroidClientCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class AndroidClientOptionsTest extends AbstractOptionsTest {
|
||||
protected static final String ARTIFACT_ID_VALUE = "swagger-java-client-test";
|
||||
protected static final String MODEL_PACKAGE_VALUE = "package";
|
||||
protected static final String API_PACKAGE_VALUE = "apiPackage";
|
||||
protected static final String INVOKER_PACKAGE_VALUE = "io.swagger.client.test";
|
||||
protected static final String SORT_PARAMS_VALUE = "false";
|
||||
protected static final String GROUP_ID_VALUE = "io.swagger.test";
|
||||
protected static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||
protected static final String SOURCE_FOLDER_VALUE = "src/main/java/test";
|
||||
protected static final String ANDROID_MAVEN_GRADLE_PLUGIN_VALUE = "true";
|
||||
|
||||
@Tested
|
||||
private AndroidClientCodegen clientCodegen;
|
||||
|
||||
@Override
|
||||
protected CodegenConfig getCodegenConfig() {
|
||||
return clientCodegen;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setExpectations() {
|
||||
new Expectations(clientCodegen) {{
|
||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
||||
times = 1;
|
||||
clientCodegen.setInvokerPackage(INVOKER_PACKAGE_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setGroupId(GROUP_ID_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setArtifactId(ARTIFACT_ID_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setArtifactVersion(ARTIFACT_VERSION_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setSourceFolder(SOURCE_FOLDER_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setUseAndroidMavenGradlePlugin(Boolean.valueOf(ANDROID_MAVEN_GRADLE_PLUGIN_VALUE));
|
||||
times = 1;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getAvaliableOptions() {
|
||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
|
||||
.put(CodegenConstants.GROUP_ID, GROUP_ID_VALUE)
|
||||
.put(CodegenConstants.ARTIFACT_ID, ARTIFACT_ID_VALUE)
|
||||
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
|
||||
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
|
||||
.put(AndroidClientCodegen.USE_ANDROID_MAVEN_GRADLE_PLUGIN, ANDROID_MAVEN_GRADLE_PLUGIN_VALUE)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package io.swagger.codegen.csharp;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.CSharpClientCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class CSharpClientOptionsTest extends AbstractOptionsTest {
|
||||
protected static final String PACKAGE_NAME_VALUE = "swagger_client_csharp";
|
||||
protected static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||
|
||||
@Tested
|
||||
private CSharpClientCodegen clientCodegen;
|
||||
|
||||
@Override
|
||||
protected CodegenConfig getCodegenConfig() {
|
||||
return clientCodegen;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setExpectations() {
|
||||
new Expectations(clientCodegen) {{
|
||||
clientCodegen.setPackageName(PACKAGE_NAME_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setPackageVersion(PACKAGE_VERSION_VALUE);
|
||||
times = 1;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getAvaliableOptions() {
|
||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||
return builder.put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE)
|
||||
.put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package io.swagger.codegen.csharpdotnettwo;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.CsharpDotNet2ClientCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class CsharpDotNet2ClientOptionsTest extends AbstractOptionsTest {
|
||||
protected static final String PACKAGE_NAME_VALUE = "swagger_client_csharp_dotnet";
|
||||
protected static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||
protected static final String CLIENT_PACKAGE_VALUE = "IO.Swagger.Client.Test";
|
||||
|
||||
@Tested
|
||||
private CsharpDotNet2ClientCodegen clientCodegen;
|
||||
|
||||
@Override
|
||||
protected CodegenConfig getCodegenConfig() {
|
||||
return clientCodegen;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setExpectations() {
|
||||
new Expectations(clientCodegen) {{
|
||||
clientCodegen.setPackageName(PACKAGE_NAME_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setPackageVersion(PACKAGE_VERSION_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setClientPackage(CLIENT_PACKAGE_VALUE);
|
||||
times = 1;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getAvaliableOptions() {
|
||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||
return builder.put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE)
|
||||
.put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE)
|
||||
.put(CsharpDotNet2ClientCodegen.CLIENT_PACKAGE, CLIENT_PACKAGE_VALUE)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package io.swagger.codegen.dart;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.DartClientCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class DartClientOptionsTest extends AbstractOptionsTest {
|
||||
protected static final String MODEL_PACKAGE_VALUE = "packagedart";
|
||||
protected static final String API_PACKAGE_VALUE = "apiPackageDart";
|
||||
protected static final String SORT_PARAMS_VALUE = "false";
|
||||
protected static final String BROWSER_CLIENT_VALUE = "true";
|
||||
protected static final String PUB_NAME_VALUE = "swagger";
|
||||
protected static final String PUB_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||
protected static final String PUB_DESCRIPTION_VALUE = "Swagger API client dart";
|
||||
protected static final String SOURCE_FOLDER_VALUE = "src";
|
||||
|
||||
@Tested
|
||||
private DartClientCodegen clientCodegen;
|
||||
|
||||
@Override
|
||||
protected CodegenConfig getCodegenConfig() {
|
||||
return clientCodegen;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setExpectations() {
|
||||
new Expectations(clientCodegen) {{
|
||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
||||
times = 1;
|
||||
clientCodegen.setBrowserClient(Boolean.valueOf(BROWSER_CLIENT_VALUE));
|
||||
times = 1;
|
||||
clientCodegen.setPubName(PUB_NAME_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setPubVersion(PUB_VERSION_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setPubDescription(PUB_DESCRIPTION_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setSourceFolder(SOURCE_FOLDER_VALUE);
|
||||
times = 1;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getAvaliableOptions() {
|
||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.put(DartClientCodegen.BROWSER_CLIENT, BROWSER_CLIENT_VALUE)
|
||||
.put(DartClientCodegen.PUB_NAME, PUB_NAME_VALUE)
|
||||
.put(DartClientCodegen.PUB_VERSION, PUB_VERSION_VALUE)
|
||||
.put(DartClientCodegen.PUB_DESCRIPTION, PUB_DESCRIPTION_VALUE)
|
||||
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package io.swagger.codegen.flash;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.FlashClientCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class FlashClienOptionsTest extends AbstractOptionsTest {
|
||||
protected static final String PACKAGE_NAME_VALUE = "io.swagger.flash";
|
||||
protected static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||
protected static final String INVOKER_PACKAGE_VALUE = "io.swagger.flash";
|
||||
protected static final String SOURCE_FOLDER_VALUE = "src/main/flex/test";
|
||||
|
||||
@Tested
|
||||
private FlashClientCodegen clientCodegen;
|
||||
|
||||
@Override
|
||||
protected CodegenConfig getCodegenConfig() {
|
||||
return clientCodegen;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setExpectations() {
|
||||
new Expectations(clientCodegen) {{
|
||||
clientCodegen.setPackageName(PACKAGE_NAME_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setPackageVersion(PACKAGE_VERSION_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setInvokerPackage(INVOKER_PACKAGE_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setSourceFolder(SOURCE_FOLDER_VALUE);
|
||||
times = 1;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getAvaliableOptions() {
|
||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||
return builder.put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE)
|
||||
.put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE)
|
||||
.put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
|
||||
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package io.swagger.codegen.nodejs;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.JavaClientCodegen;
|
||||
import io.swagger.codegen.languages.NodeJSServerCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class NodeJSServerOptionsTest extends AbstractOptionsTest {
|
||||
private static final String MODEL_PACKAGE_VALUE = "package";
|
||||
private static final String API_PACKAGE_VALUE = "apiPackage";
|
||||
private static final String SORT_PARAMS_VALUE = "false";
|
||||
|
||||
@Tested
|
||||
private NodeJSServerCodegen clientCodegen;
|
||||
|
||||
@Override
|
||||
protected CodegenConfig getCodegenConfig() {
|
||||
return clientCodegen;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setExpectations() {
|
||||
new Expectations(clientCodegen) {{
|
||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
||||
times = 1;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getAvaliableOptions() {
|
||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package io.swagger.codegen.php;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.PhpClientCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class PhpClientOptionsTest extends AbstractOptionsTest {
|
||||
protected static final String MODEL_PACKAGE_VALUE = "package";
|
||||
protected static final String API_PACKAGE_VALUE = "apiPackage";
|
||||
protected static final String SORT_PARAMS_VALUE = "false";
|
||||
protected static final String VARIABLE_NAMING_CONVENTION_VALUE = "snake_case";
|
||||
protected static final String INVOKER_PACKAGE_VALUE = "Swagger\\Client\\Php";
|
||||
protected static final String PACKAGE_PATH_VALUE = "SwaggerClient-php";
|
||||
protected static final String SRC_BASE_PATH_VALUE = "libPhp";
|
||||
protected static final String COMPOSER_VENDOR_NAME_VALUE = "swaggerPhp";
|
||||
protected static final String COMPOSER_PROJECT_NAME_VALUE = "swagger-client-php";
|
||||
protected static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||
|
||||
@Tested
|
||||
private PhpClientCodegen clientCodegen;
|
||||
|
||||
@Override
|
||||
protected CodegenConfig getCodegenConfig() {
|
||||
return clientCodegen;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setExpectations() {
|
||||
new Expectations(clientCodegen) {{
|
||||
clientCodegen.setModelPackage(MODEL_PACKAGE_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setApiPackage(API_PACKAGE_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(SORT_PARAMS_VALUE));
|
||||
times = 1;
|
||||
clientCodegen.setParameterNamingConvention(VARIABLE_NAMING_CONVENTION_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setInvokerPackage(INVOKER_PACKAGE_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setPackagePath(PACKAGE_PATH_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setSrcBasePath(SRC_BASE_PATH_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setComposerVendorName(COMPOSER_VENDOR_NAME_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setComposerProjectName(COMPOSER_PROJECT_NAME_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setArtifactVersion(ARTIFACT_VERSION_VALUE);
|
||||
times = 1;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getAvaliableOptions() {
|
||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.put(PhpClientCodegen.VARIABLE_NAMING_CONVENTION, VARIABLE_NAMING_CONVENTION_VALUE)
|
||||
.put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
|
||||
.put(PhpClientCodegen.PACKAGE_PATH, PACKAGE_PATH_VALUE)
|
||||
.put(PhpClientCodegen.SRC_BASE_PATH, SRC_BASE_PATH_VALUE)
|
||||
.put(PhpClientCodegen.COMPOSER_VENDOR_NAME, COMPOSER_VENDOR_NAME_VALUE)
|
||||
.put(PhpClientCodegen.COMPOSER_PROJECT_NAME, COMPOSER_PROJECT_NAME_VALUE)
|
||||
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package io.swagger.codegen.python;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.PythonClientCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class PythonClientOptionsTest extends AbstractOptionsTest {
|
||||
protected static final String PACKAGE_NAME_VALUE = "swagger_client_python";
|
||||
protected static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||
|
||||
@Tested
|
||||
private PythonClientCodegen clientCodegen;
|
||||
|
||||
@Override
|
||||
protected CodegenConfig getCodegenConfig() {
|
||||
return clientCodegen;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setExpectations() {
|
||||
new Expectations(clientCodegen) {{
|
||||
clientCodegen.setPackageName(PACKAGE_NAME_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setPackageVersion(PACKAGE_VERSION_VALUE);
|
||||
times = 1;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getAvaliableOptions() {
|
||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||
return builder.put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE)
|
||||
.put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package io.swagger.codegen.ruby;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.languages.RubyClientCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class RubyClientOptionsTest extends AbstractOptionsTest {
|
||||
private static final String GEM_NAME_VALUE = "swagger_client_ruby";
|
||||
private static final String MODULE_NAME_VALUE = "SwaggerClientRuby";
|
||||
private static final String GEM_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||
|
||||
@Tested
|
||||
private RubyClientCodegen clientCodegen;
|
||||
|
||||
@Override
|
||||
protected CodegenConfig getCodegenConfig() {
|
||||
return clientCodegen;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setExpectations() {
|
||||
new Expectations(clientCodegen) {{
|
||||
clientCodegen.setGemName(GEM_NAME_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setModuleName(MODULE_NAME_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setGemVersion(GEM_VERSION_VALUE);
|
||||
times = 1;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getAvaliableOptions() {
|
||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||
return builder.put(RubyClientCodegen.GEM_NAME, GEM_NAME_VALUE)
|
||||
.put(RubyClientCodegen.MODULE_NAME, MODULE_NAME_VALUE)
|
||||
.put(RubyClientCodegen.GEM_VERSION, GEM_VERSION_VALUE)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user