|
1 | 1 | package com.backbase.oss.codegen.java; |
2 | 2 |
|
| 3 | +import static com.backbase.oss.codegen.java.BoatJavaCodeGen.CREATE_API_COMPONENT; |
| 4 | +import static com.backbase.oss.codegen.java.BoatJavaCodeGen.REST_TEMPLATE_BEAN_NAME; |
| 5 | +import static com.backbase.oss.codegen.java.BoatJavaCodeGen.USE_CLASS_LEVEL_BEAN_VALIDATION; |
| 6 | +import static com.backbase.oss.codegen.java.BoatJavaCodeGen.USE_DEFAULT_API_CLIENT; |
| 7 | +import static com.backbase.oss.codegen.java.BoatJavaCodeGen.USE_JACKSON_CONVERSION; |
| 8 | +import static com.backbase.oss.codegen.java.BoatJavaCodeGen.USE_PROTECTED_FIELDS; |
| 9 | +import static com.backbase.oss.codegen.java.BoatJavaCodeGen.USE_WITH_MODIFIERS; |
| 10 | +import static java.util.stream.Collectors.groupingBy; |
| 11 | +import static org.hamcrest.MatcherAssert.assertThat; |
| 12 | +import static org.hamcrest.Matchers.hasEntry; |
| 13 | +import static org.hamcrest.Matchers.is; |
| 14 | +import static org.hamcrest.Matchers.nullValue; |
| 15 | +import static org.junit.jupiter.api.Assertions.assertEquals; |
| 16 | + |
3 | 17 | import com.github.javaparser.StaticJavaParser; |
4 | 18 | import com.github.javaparser.ast.CompilationUnit; |
5 | 19 | import com.github.javaparser.ast.body.MethodDeclaration; |
6 | 20 | import com.github.javaparser.ast.body.TypeDeclaration; |
7 | 21 | import io.swagger.parser.OpenAPIParser; |
8 | 22 | import io.swagger.v3.parser.core.models.ParseOptions; |
| 23 | +import java.io.File; |
| 24 | +import java.io.FileNotFoundException; |
| 25 | +import java.util.List; |
| 26 | +import java.util.Map; |
| 27 | +import java.util.function.Function; |
9 | 28 | import org.junit.jupiter.api.Test; |
10 | 29 | import org.junit.jupiter.params.ParameterizedTest; |
11 | 30 | import org.junit.jupiter.params.provider.ValueSource; |
12 | 31 | import org.openapitools.codegen.CliOption; |
13 | 32 | import org.openapitools.codegen.ClientOptInput; |
14 | 33 | import org.openapitools.codegen.DefaultGenerator; |
15 | 34 |
|
16 | | -import java.io.File; |
17 | | -import java.io.FileNotFoundException; |
18 | | -import java.util.function.Function; |
19 | | -import java.util.List; |
20 | | -import java.util.Map; |
21 | | - |
22 | | -import static com.backbase.oss.codegen.java.BoatJavaCodeGen.*; |
23 | | -import static java.util.stream.Collectors.groupingBy; |
24 | | -import static org.hamcrest.MatcherAssert.assertThat; |
25 | | -import static org.hamcrest.Matchers.*; |
26 | | -import static org.junit.jupiter.api.Assertions.assertEquals; |
27 | | - |
28 | 35 | class BoatJavaCodeGenTests { |
29 | 36 |
|
30 | 37 | static final String PROP_BASE = BoatJavaCodeGenTests.class.getSimpleName() + "."; |
@@ -115,10 +122,10 @@ void processOptsUseProtectedFields() { |
115 | 122 |
|
116 | 123 | @ParameterizedTest |
117 | 124 | @ValueSource(booleans = {true, false}) |
118 | | - void shouldHonourGenerateComponentAnnotation(boolean generate) throws InterruptedException, FileNotFoundException { |
| 125 | + void shouldHonourGenerateComponentAnnotation(boolean generate) throws FileNotFoundException { |
119 | 126 |
|
120 | 127 | var input = new File("src/test/resources/boat-spring/openapi.yaml"); |
121 | | - var output = TEST_OUTPUT + "/shouldNotGenerateComponentAnnotation/" + String.valueOf(generate); |
| 128 | + var output = TEST_OUTPUT + "/shouldNotGenerateComponentAnnotation/" + generate; |
122 | 129 |
|
123 | 130 | final BoatJavaCodeGen gen = new BoatJavaCodeGen(); |
124 | 131 | gen.setOutputDir(output); |
@@ -162,10 +169,10 @@ void shouldHonourGenerateComponentAnnotation(boolean generate) throws Interrupte |
162 | 169 |
|
163 | 170 | @ParameterizedTest |
164 | 171 | @ValueSource(booleans = {true, false}) |
165 | | - void shouldHonourBeanValidationOption(boolean useBeanValidation) throws InterruptedException, FileNotFoundException { |
| 172 | + void shouldHonourBeanValidationOption(boolean useBeanValidation) throws FileNotFoundException { |
166 | 173 |
|
167 | 174 | var input = new File("src/test/resources/boat-spring/openapi.yaml"); |
168 | | - var output = TEST_OUTPUT + "/shouldHonourBeanValidationOption/" + String.valueOf(useBeanValidation); |
| 175 | + var output = TEST_OUTPUT + "/shouldHonourBeanValidationOption/" + useBeanValidation; |
169 | 176 |
|
170 | 177 | final BoatJavaCodeGen gen = new BoatJavaCodeGen(); |
171 | 178 | gen.setOutputDir(output); |
|
0 commit comments