forked from loafle/openapi-generator-original
Add tests to online generator (#1591)
This commit is contained in:
parent
cd61442387
commit
001f89f1d9
@ -13,7 +13,9 @@
|
|||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||||
|
<spring-boot-version>2.0.7.RELEASE</spring-boot-version>
|
||||||
<springfox-version>2.8.0</springfox-version>
|
<springfox-version>2.8.0</springfox-version>
|
||||||
|
<junit-version>4.12</junit-version>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@ -85,5 +87,23 @@
|
|||||||
<artifactId>openapi-generator</artifactId>
|
<artifactId>openapi-generator</artifactId>
|
||||||
<version>${project.parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.hamcrest</groupId>
|
||||||
|
<artifactId>java-hamcrest</artifactId>
|
||||||
|
<version>2.0.0.0</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
@ -69,12 +69,8 @@ public class GenApiService implements GenApiDelegate {
|
|||||||
servers.sort(String.CASE_INSENSITIVE_ORDER);
|
servers.sort(String.CASE_INSENSITIVE_ORDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final NativeWebRequest request;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public GenApiService(NativeWebRequest request) {
|
private NativeWebRequest request;
|
||||||
this.request = request;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<NativeWebRequest> getRequest() {
|
public Optional<NativeWebRequest> getRequest() {
|
||||||
|
@ -50,7 +50,7 @@ public class Generator {
|
|||||||
try {
|
try {
|
||||||
config = CodegenConfigLoader.forName(language);
|
config = CodegenConfigLoader.forName(language);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ResponseStatusException(HttpStatus.BAD_REQUEST, String.format(Locale.ROOT,"Unsupported target %s supplied. %s",
|
throw new ResponseStatusException(HttpStatus.NOT_FOUND, String.format(Locale.ROOT,"Unsupported target %s supplied. %s",
|
||||||
language, e));
|
language, e));
|
||||||
}
|
}
|
||||||
Map<String, CliOption> map = new LinkedHashMap<>();
|
Map<String, CliOption> map = new LinkedHashMap<>();
|
||||||
|
1
pom.xml
1
pom.xml
@ -1357,6 +1357,5 @@
|
|||||||
<surefire-version>2.22.0</surefire-version>
|
<surefire-version>2.22.0</surefire-version>
|
||||||
<jmockit-version>1.43</jmockit-version>
|
<jmockit-version>1.43</jmockit-version>
|
||||||
<reflections-version>0.9.10</reflections-version>
|
<reflections-version>0.9.10</reflections-version>
|
||||||
<spring-boot-version>2.0.2.RELEASE</spring-boot-version>
|
|
||||||
</properties>
|
</properties>
|
||||||
</project>
|
</project>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user