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>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<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>
|
||||
<junit-version>4.12</junit-version>
|
||||
</properties>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
@ -85,5 +87,23 @@
|
||||
<artifactId>openapi-generator</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</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>
|
||||
</project>
|
||||
|
@ -69,12 +69,8 @@ public class GenApiService implements GenApiDelegate {
|
||||
servers.sort(String.CASE_INSENSITIVE_ORDER);
|
||||
}
|
||||
|
||||
private final NativeWebRequest request;
|
||||
|
||||
@Autowired
|
||||
public GenApiService(NativeWebRequest request) {
|
||||
this.request = request;
|
||||
}
|
||||
private NativeWebRequest request;
|
||||
|
||||
@Override
|
||||
public Optional<NativeWebRequest> getRequest() {
|
||||
|
@ -50,7 +50,7 @@ public class Generator {
|
||||
try {
|
||||
config = CodegenConfigLoader.forName(language);
|
||||
} 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));
|
||||
}
|
||||
Map<String, CliOption> map = new LinkedHashMap<>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user