forked from loafle/openapi-generator-original
processOptions tests have been added for Objc, perl, spring-mvc, swift, scala, async-scala, qt5cpp, html, dynamic-html, swagger, swagger-yaml, tizen, typescript-angular, typescript-node, akka-scala, inflector, scalatra, silex and sinatra
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
package io.swagger.codegen.akkascala;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.AkkaScalaClientCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class AkkaScalaClientOptionsTest 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";
|
||||
|
||||
@Tested
|
||||
private AkkaScalaClientCodegen 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,47 @@
|
||||
package io.swagger.codegen.asyncscala;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.AsyncScalaClientCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class AsyncScalaClientOptionsTest 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";
|
||||
|
||||
@Tested
|
||||
private AsyncScalaClientCodegen 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,49 @@
|
||||
package io.swagger.codegen.inflector;
|
||||
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.java.JavaClientOptionsTest;
|
||||
import io.swagger.codegen.languages.JavaInflectorServerCodegen;
|
||||
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
public class JavaInflectorServerOptionsTest extends JavaClientOptionsTest {
|
||||
|
||||
@Tested
|
||||
private JavaInflectorServerCodegen 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.setLocalVariablePrefix(LOCAL_PREFIX_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setSerializableModel(Boolean.valueOf(SERIALIZABLE_MODEL_VALUE));
|
||||
times = 1;
|
||||
clientCodegen.setLibrary(LIBRARY_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setFullJavaUtil(Boolean.valueOf(FULL_JAVA_UTIL_VALUE));
|
||||
times = 1;
|
||||
}};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package io.swagger.codegen.objc;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.ObjcClientCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class ObjcClientOptionsTest extends AbstractOptionsTest {
|
||||
private static final String CLASS_PREFIX_VALUE = "SWGObjc";
|
||||
private static final String POD_NAME_VALUE = "SwaggerClientObjc";
|
||||
private static final String POD_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||
private static final String AUTHOR_NAME_VALUE = "SwaggerObjc";
|
||||
private static final String AUTHOR_EMAIL_VALUE = "objc@swagger.io";
|
||||
private static final String GIT_REPO_URL_VALUE = "https://github.com/swagger-api/swagger-codegen";
|
||||
private static final String LICENSE_VALUE = "MIT";
|
||||
|
||||
@Tested
|
||||
private ObjcClientCodegen clientCodegen;
|
||||
|
||||
@Override
|
||||
protected CodegenConfig getCodegenConfig() {
|
||||
return clientCodegen;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setExpectations() {
|
||||
new Expectations(clientCodegen) {{
|
||||
clientCodegen.setClassPrefix(CLASS_PREFIX_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setPodName(POD_NAME_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setPodVersion(POD_VERSION_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setAuthorName(AUTHOR_NAME_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setAuthorEmail(AUTHOR_EMAIL_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setGitRepoURL(GIT_REPO_URL_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setLicense(LICENSE_VALUE);
|
||||
times = 1;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getAvaliableOptions() {
|
||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||
return builder.put(ObjcClientCodegen.CLASS_PREFIX, CLASS_PREFIX_VALUE)
|
||||
.put(ObjcClientCodegen.POD_NAME, POD_NAME_VALUE)
|
||||
.put(CodegenConstants.POD_VERSION, POD_VERSION_VALUE)
|
||||
.put(ObjcClientCodegen.AUTHOR_NAME, AUTHOR_NAME_VALUE)
|
||||
.put(ObjcClientCodegen.AUTHOR_EMAIL, AUTHOR_EMAIL_VALUE)
|
||||
.put(ObjcClientCodegen.GIT_REPO_URL, GIT_REPO_URL_VALUE)
|
||||
.put(ObjcClientCodegen.LICENSE, LICENSE_VALUE)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package io.swagger.codegen.perl;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.PerlClientCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class PerlClientOptionsTest extends AbstractOptionsTest {
|
||||
private static final String MODULE_NAME_VALUE = "";
|
||||
private static final String MODULE_VERSION_VALUE = "";
|
||||
|
||||
@Tested
|
||||
private PerlClientCodegen clientCodegen;
|
||||
|
||||
@Override
|
||||
protected CodegenConfig getCodegenConfig() {
|
||||
return clientCodegen;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setExpectations() {
|
||||
new Expectations(clientCodegen) {{
|
||||
clientCodegen.setModuleName(MODULE_NAME_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setModuleVersion(MODULE_VERSION_VALUE);
|
||||
times = 1;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getAvaliableOptions() {
|
||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||
return builder.put(PerlClientCodegen.MODULE_NAME, MODULE_NAME_VALUE)
|
||||
.put(PerlClientCodegen.MODULE_VERSION, MODULE_VERSION_VALUE)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package io.swagger.codegen.qtfivecpp;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.Qt5CPPGenerator;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class Qt5CPPOptionsTest 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";
|
||||
|
||||
@Tested
|
||||
private Qt5CPPGenerator 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,47 @@
|
||||
package io.swagger.codegen.scala;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.ScalaClientCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class ScalaClientOptionsTest 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";
|
||||
|
||||
@Tested
|
||||
private ScalaClientCodegen 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,47 @@
|
||||
package io.swagger.codegen.scalatra;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.ScalatraServerCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class ScalatraServerOptionsTest 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";
|
||||
|
||||
@Tested
|
||||
private ScalatraServerCodegen 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,47 @@
|
||||
package io.swagger.codegen.silex;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.SilexServerCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class SilexServerOptionsTest 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";
|
||||
|
||||
@Tested
|
||||
private SilexServerCodegen 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,34 @@
|
||||
package io.swagger.codegen.sinatra;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.languages.SinatraServerCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class SinatraServerOptionsTest extends AbstractOptionsTest {
|
||||
|
||||
@Tested
|
||||
private SinatraServerCodegen clientCodegen;
|
||||
|
||||
@Override
|
||||
protected CodegenConfig getCodegenConfig() {
|
||||
return clientCodegen;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setExpectations() {
|
||||
new Expectations(clientCodegen) {{
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getAvaliableOptions() {
|
||||
//SinatraServerCodegen doesn't have its own options and base options are cleared
|
||||
return ImmutableMap.of();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package io.swagger.codegen.springmvc;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.java.JavaClientOptionsTest;
|
||||
import io.swagger.codegen.languages.JavaClientCodegen;
|
||||
import io.swagger.codegen.languages.SpringMVCServerCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class SpringMVCServerOptionsTest extends JavaClientOptionsTest {
|
||||
protected static final String CONFIG_PACKAGE_VALUE = "configPackage";
|
||||
|
||||
@Tested
|
||||
private SpringMVCServerCodegen 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.setLocalVariablePrefix(LOCAL_PREFIX_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setSerializableModel(Boolean.valueOf(SERIALIZABLE_MODEL_VALUE));
|
||||
times = 1;
|
||||
clientCodegen.setLibrary(LIBRARY_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setFullJavaUtil(Boolean.valueOf(FULL_JAVA_UTIL_VALUE));
|
||||
times = 1;
|
||||
clientCodegen.setConfigPackage(CONFIG_PACKAGE_VALUE);
|
||||
times = 1;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getAvaliableOptions() {
|
||||
Map<String, String> options = new HashMap<String, String>(super.getAvaliableOptions());
|
||||
options.put(SpringMVCServerCodegen.CONFIG_PACKAGE, CONFIG_PACKAGE_VALUE);
|
||||
return options;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package io.swagger.codegen.staticDocs;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.StaticDocCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class StaticDocOptionsTest 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";
|
||||
|
||||
@Tested
|
||||
private StaticDocCodegen 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,47 @@
|
||||
package io.swagger.codegen.statichtml;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.StaticHtmlGenerator;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class StaticHtmlOptionsTest 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";
|
||||
|
||||
@Tested
|
||||
private StaticHtmlGenerator 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,47 @@
|
||||
package io.swagger.codegen.swagger;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.SwaggerGenerator;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class SwaggerOptionsTest 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";
|
||||
|
||||
@Tested
|
||||
private SwaggerGenerator 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,47 @@
|
||||
package io.swagger.codegen.swaggeryaml;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.SwaggerYamlGenerator;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class SwaggerYamlOptionsTest 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";
|
||||
|
||||
@Tested
|
||||
private SwaggerYamlGenerator 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,82 @@
|
||||
package io.swagger.codegen.swift;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.SwiftCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class SwiftOptionsTest 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 PROJECT_NAME_VALUE = "Swagger";
|
||||
protected static final String RESPONSE_AS_VALUE = "test";
|
||||
protected static final String UNWRAP_REQUIRED_VALUE = "true";
|
||||
protected static final String POD_SOURCE_VALUE = "{ :git => 'git@github.com:swagger-api/swagger-mustache.git'," +
|
||||
" :tag => 'v1.0.0-SNAPSHOT' }";
|
||||
protected static final String POD_VERSION_VALUE = "v1.0.0-SNAPSHOT";
|
||||
protected static final String POD_AUTHORS_VALUE = "podAuthors";
|
||||
protected static final String POD_SOCIAL_MEDIA_URL_VALUE = "podSocialMediaURL";
|
||||
protected static final String POD_DOCSET_URL_VALUE = "podDocsetURL";
|
||||
protected static final String POD_LICENSE_VALUE = "'Apache License, Version 2.0'";
|
||||
protected static final String POD_HOMEPAGE_VALUE = "podHomepage";
|
||||
protected static final String POD_SUMMARY_VALUE = "podSummary";
|
||||
protected static final String POD_DESCRIPTION_VALUE = "podDescription";
|
||||
protected static final String POD_SCREENSHOTS_VALUE = "podScreenshots";
|
||||
protected static final String POD_DOCUMENTATION_URL_VALUE = "podDocumentationURL";
|
||||
|
||||
@Tested
|
||||
private SwiftCodegen 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.setProjectName(PROJECT_NAME_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setResponseAs(RESPONSE_AS_VALUE.split(","));
|
||||
times = 1;
|
||||
clientCodegen.setUnwrapRequired(Boolean.valueOf(UNWRAP_REQUIRED_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(SwiftCodegen.PROJECT_NAME, PROJECT_NAME_VALUE)
|
||||
.put(SwiftCodegen.RESPONSE_AS, RESPONSE_AS_VALUE)
|
||||
.put(SwiftCodegen.UNWRAP_REQUIRED, UNWRAP_REQUIRED_VALUE)
|
||||
.put(SwiftCodegen.POD_SOURCE, POD_SOURCE_VALUE)
|
||||
.put(CodegenConstants.POD_VERSION, POD_VERSION_VALUE)
|
||||
.put(SwiftCodegen.POD_AUTHORS, POD_AUTHORS_VALUE)
|
||||
.put(SwiftCodegen.POD_SOCIAL_MEDIA_URL, POD_SOCIAL_MEDIA_URL_VALUE)
|
||||
.put(SwiftCodegen.POD_DOCSET_URL, POD_DOCSET_URL_VALUE)
|
||||
.put(SwiftCodegen.POD_LICENSE, POD_LICENSE_VALUE)
|
||||
.put(SwiftCodegen.POD_HOMEPAGE, POD_HOMEPAGE_VALUE)
|
||||
.put(SwiftCodegen.POD_SUMMARY, POD_SUMMARY_VALUE)
|
||||
.put(SwiftCodegen.POD_DESCRIPTION, POD_DESCRIPTION_VALUE)
|
||||
.put(SwiftCodegen.POD_SCREENSHOTS, POD_SCREENSHOTS_VALUE)
|
||||
.put(SwiftCodegen.POD_DOCUMENTATION_URL, POD_DOCUMENTATION_URL_VALUE)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package io.swagger.codegen.tizen;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.TizenClientCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class TizenClientOptionsTest 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";
|
||||
|
||||
@Tested
|
||||
private TizenClientCodegen 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,47 @@
|
||||
package io.swagger.codegen.typescriptangular;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.TypeScriptAngularClientCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class TypeScriptAngularClientOptionsTest 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";
|
||||
|
||||
@Tested
|
||||
private TypeScriptAngularClientCodegen 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,47 @@
|
||||
package io.swagger.codegen.typescriptnode;
|
||||
|
||||
import io.swagger.codegen.AbstractOptionsTest;
|
||||
import io.swagger.codegen.CodegenConfig;
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.TypeScriptNodeClientCodegen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class TypeScriptNodeClientOptionsTest 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";
|
||||
|
||||
@Tested
|
||||
private TypeScriptNodeClientCodegen 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user