forked from loafle/openapi-generator-original
fixes
This commit is contained in:
@@ -22,6 +22,7 @@ public abstract class AbstractOptionsTest {
|
||||
this.optionsProvider = optionsProvider;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Test
|
||||
public void checkOptionsProcessing() {
|
||||
getCodegenConfig().additionalProperties().putAll(optionsProvider.createOptions());
|
||||
@@ -49,7 +50,7 @@ public abstract class AbstractOptionsTest {
|
||||
}
|
||||
}
|
||||
|
||||
private Function<CliOption, String> getCliOptionTransformer() {
|
||||
private static Function<CliOption, String> getCliOptionTransformer() {
|
||||
return new Function<CliOption, String>() {
|
||||
@Override
|
||||
public String apply(CliOption option) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import org.testng.annotations.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings("static-method")
|
||||
public class ClientAuthInputTest {
|
||||
|
||||
@Test(description = "read a file upload param from a 2.0 spec")
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.util.Set;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
@SuppressWarnings("static-method")
|
||||
public class CodegenConfigLoaderTest {
|
||||
|
||||
@DataProvider(name = "codegenConfig")
|
||||
|
||||
@@ -189,7 +189,7 @@ public class CodegenTest {
|
||||
|
||||
}
|
||||
|
||||
private Swagger parseAndPrepareSwagger(String path) {
|
||||
private static Swagger parseAndPrepareSwagger(String path) {
|
||||
Swagger swagger = new SwaggerParser().read(path);
|
||||
// resolve inline models
|
||||
new InlineModelResolver().flatten(swagger);
|
||||
|
||||
@@ -200,13 +200,13 @@ public class DefaultGeneratorTest {
|
||||
}
|
||||
}
|
||||
|
||||
private void changeContent(File file) throws IOException {
|
||||
private static void changeContent(File file) throws IOException {
|
||||
Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), UTF_8));
|
||||
out.write(TEST_SKIP_OVERWRITE);
|
||||
out.close();
|
||||
}
|
||||
|
||||
private CodegenOperation findCodegenOperationByOperationId(Map<String, List<CodegenOperation>> paths, String operationId) {
|
||||
private static CodegenOperation findCodegenOperationByOperationId(Map<String, List<CodegenOperation>> paths, String operationId) {
|
||||
for (List<CodegenOperation> ops : paths.values()) {
|
||||
for (CodegenOperation co : ops) {
|
||||
if (operationId.equals(co.operationId)) {
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@SuppressWarnings("static-method")
|
||||
public class ExampleGeneratorTest {
|
||||
|
||||
@Test(description = "check handling of recursive models")
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.util.Map;
|
||||
|
||||
import static org.testng.AssertJUnit.*;
|
||||
|
||||
@SuppressWarnings("static-method")
|
||||
public class InlineModelResolverTest {
|
||||
@Test
|
||||
public void resolveInlineModelTest() throws Exception {
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.swagger.parser.SwaggerParser;
|
||||
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@SuppressWarnings("static-method")
|
||||
public class SwaggerMigratorTest {
|
||||
|
||||
@Test(description = "read a 1.2 spec")
|
||||
|
||||
@@ -25,6 +25,7 @@ import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertFalse;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
@SuppressWarnings("static-method")
|
||||
public class CodegenConfiguratorTest {
|
||||
|
||||
@Mocked
|
||||
@@ -76,6 +77,7 @@ public class CodegenConfiguratorTest {
|
||||
assertValueInMap(clientOptInput.getConfig().additionalProperties(), CodegenConstants.TEMPLATE_DIR, toAbsolutePathDir(templateDir));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Test
|
||||
public void testSystemProperties() throws Exception {
|
||||
|
||||
@@ -287,6 +289,7 @@ public class CodegenConfiguratorTest {
|
||||
assertValueInMap(configurator.getDynamicProperties(), CodegenConstants.LOCAL_VARIABLE_PREFIX, "_");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private ClientOptInput setupAndRunGenericTest(CodegenConfigurator configurator) {
|
||||
|
||||
final String spec = "swagger.yaml";
|
||||
@@ -316,10 +319,11 @@ public class CodegenConfiguratorTest {
|
||||
return result;
|
||||
}
|
||||
|
||||
private String toAbsolutePathDir(String outputDir) {
|
||||
private static String toAbsolutePathDir(String outputDir) {
|
||||
return Paths.get(outputDir).toAbsolutePath().toAbsolutePath().toString();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private void setupStandardExpectations(final String spec, final String languageName, final String auth, final CodegenConfig config) {
|
||||
|
||||
new StrictExpectations() {{
|
||||
@@ -340,7 +344,7 @@ public class CodegenConfiguratorTest {
|
||||
}};
|
||||
}
|
||||
|
||||
private void assertValueInMap(Map map, String propertyKey, String expectedPropertyValue) {
|
||||
private static void assertValueInMap(Map<?, ?> map, String propertyKey, String expectedPropertyValue) {
|
||||
assertTrue(map.containsKey(propertyKey));
|
||||
assertEquals(map.get(propertyKey), expectedPropertyValue);
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@ import io.swagger.codegen.options.FlashClienOptionsProvider;
|
||||
import mockit.Expectations;
|
||||
import mockit.Tested;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class FlashClienOptionsTest extends AbstractOptionsTest {
|
||||
|
||||
@Tested
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.google.common.collect.Sets;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@SuppressWarnings("static-method")
|
||||
public class TypeScriptNodeModelTest {
|
||||
|
||||
@Test(description = "convert a simple TypeScript Node model")
|
||||
|
||||
Reference in New Issue
Block a user