[kotlin][client] remove old Date usage (#11082)

* [kotlin][client] remove old Date usage

* [kotlin][client] remove old Date usage
This commit is contained in:
Bruno Coelho
2021-12-14 08:03:12 +00:00
committed by GitHub
parent 5416e92d19
commit eb224db540
515 changed files with 816 additions and 26447 deletions

View File

@@ -5,13 +5,13 @@ settings.gradle
src/main/kotlin/org/openapitools/Application.kt
src/main/kotlin/org/openapitools/api/ApiUtil.kt
src/main/kotlin/org/openapitools/api/Exceptions.kt
src/main/kotlin/org/openapitools/api/PetApi.kt
src/main/kotlin/org/openapitools/api/PetApiController.kt
src/main/kotlin/org/openapitools/api/PetApiService.kt
src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt
src/main/kotlin/org/openapitools/api/StoreApi.kt
src/main/kotlin/org/openapitools/api/StoreApiController.kt
src/main/kotlin/org/openapitools/api/StoreApiService.kt
src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt
src/main/kotlin/org/openapitools/api/UserApi.kt
src/main/kotlin/org/openapitools/api/UserApiController.kt
src/main/kotlin/org/openapitools/api/UserApiService.kt
src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt
src/main/kotlin/org/openapitools/model/Category.kt

View File

@@ -1 +1 @@
5.0.1-SNAPSHOT
5.3.1-SNAPSHOT

View File

@@ -30,7 +30,7 @@ plugins {
}
dependencies {
val kotlinxCoroutinesVersion="1.2.0"
val kotlinxCoroutinesVersion="1.2.0"
compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
compile("org.jetbrains.kotlin:kotlin-reflect")
compile("org.springframework.boot:spring-boot-starter-web")
@@ -46,7 +46,7 @@ dependencies {
}
repositories {
maven { url = uri("https://repo1.maven.org/maven2") }
maven { url = uri("https://repo.spring.io/snapshot") }
maven { url = uri("https://repo.spring.io/milestone") }
maven { url = uri("https://repo1.maven.org/maven2") }
maven { url = uri("https://repo.spring.io/snapshot") }
maven { url = uri("https://repo.spring.io/milestone") }
}

View File

@@ -7,7 +7,7 @@
<version>1.0.0</version>
<properties>
<kotlin.version>1.3.30</kotlin.version>
<kotlinx-coroutines.version>1.2.0</kotlinx-coroutines.version>
<kotlinx-coroutines.version>1.2.0</kotlinx-coroutines.version>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
</properties>
<parent>
@@ -111,8 +111,8 @@
</dependency>
<!-- Bean Validation API support -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
@@ -127,34 +127,34 @@
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
</pluginRepositories>
</project>

View File

@@ -1,15 +1,15 @@
pluginManagement {
repositories {
maven { url = uri("https://repo.spring.io/snapshot") }
maven { url = uri("https://repo.spring.io/milestone") }
gradlePluginPortal()
}
resolutionStrategy {
eachPlugin {
if (requested.id.id == "org.springframework.boot") {
useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}")
}
}
}
repositories {
maven { url = uri("https://repo.spring.io/snapshot") }
maven { url = uri("https://repo.spring.io/milestone") }
gradlePluginPortal()
}
resolutionStrategy {
eachPlugin {
if (requested.id.id == "org.springframework.boot") {
useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}")
}
}
}
}
rootProject.name = "openapi-spring"
rootProject.name = "openapi-spring"

View File

@@ -43,7 +43,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])])
@ApiResponses(
value = [ApiResponse(code = 405, message = "Invalid input")])
@PostMapping(
@RequestMapping(
method = [RequestMethod.POST],
value = ["/pet"],
consumes = ["application/json", "application/xml"]
)
@@ -59,7 +60,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])])
@ApiResponses(
value = [ApiResponse(code = 400, message = "Invalid pet value")])
@DeleteMapping(
@RequestMapping(
method = [RequestMethod.DELETE],
value = ["/pet/{petId}"]
)
fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: kotlin.Long
@@ -77,7 +79,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])])
@ApiResponses(
value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")])
@GetMapping(
@RequestMapping(
method = [RequestMethod.GET],
value = ["/pet/findByStatus"],
produces = ["application/xml", "application/json"]
)
@@ -95,7 +98,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])])
@ApiResponses(
value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")])
@GetMapping(
@RequestMapping(
method = [RequestMethod.GET],
value = ["/pet/findByTags"],
produces = ["application/xml", "application/json"]
)
@@ -112,7 +116,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
authorizations = [Authorization(value = "api_key")])
@ApiResponses(
value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")])
@GetMapping(
@RequestMapping(
method = [RequestMethod.GET],
value = ["/pet/{petId}"],
produces = ["application/xml", "application/json"]
)
@@ -128,7 +133,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])])
@ApiResponses(
value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")])
@PutMapping(
@RequestMapping(
method = [RequestMethod.PUT],
value = ["/pet"],
consumes = ["application/json", "application/xml"]
)
@@ -144,7 +150,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])])
@ApiResponses(
value = [ApiResponse(code = 405, message = "Invalid input")])
@PostMapping(
@RequestMapping(
method = [RequestMethod.POST],
value = ["/pet/{petId}"],
consumes = ["application/x-www-form-urlencoded"]
)
@@ -163,7 +170,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])])
@ApiResponses(
value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)])
@PostMapping(
@RequestMapping(
method = [RequestMethod.POST],
value = ["/pet/{petId}/uploadImage"],
produces = ["application/json"],
consumes = ["multipart/form-data"]

View File

@@ -2,21 +2,93 @@ package org.openapitools.api
import org.openapitools.model.ModelApiResponse
import org.openapitools.model.Pet
interface PetApiService {
fun addPet(body: Pet): Unit
/**
* POST /pet : Add a new pet to the store
*
* @param body Pet object that needs to be added to the store (required)
* @return Invalid input (status code 405)
* @see PetApi#addPet
*/
fun addPet(body: Pet): Unit
fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit
/**
* DELETE /pet/{petId} : Deletes a pet
*
* @param petId Pet id to delete (required)
* @param apiKey (optional)
* @return Invalid pet value (status code 400)
* @see PetApi#deletePet
*/
fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit
fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>): List<Pet>
/**
* GET /pet/findByStatus : Finds Pets by status
* Multiple status values can be provided with comma separated strings
*
* @param status Status values that need to be considered for filter (required)
* @return successful operation (status code 200)
* or Invalid status value (status code 400)
* @see PetApi#findPetsByStatus
*/
fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>): List<Pet>
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>): List<Pet>
/**
* GET /pet/findByTags : Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
*
* @param tags Tags to filter by (required)
* @return successful operation (status code 200)
* or Invalid tag value (status code 400)
* @deprecated
* @see PetApi#findPetsByTags
*/
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>): List<Pet>
fun getPetById(petId: kotlin.Long): Pet
/**
* GET /pet/{petId} : Find pet by ID
* Returns a single pet
*
* @param petId ID of pet to return (required)
* @return successful operation (status code 200)
* or Invalid ID supplied (status code 400)
* or Pet not found (status code 404)
* @see PetApi#getPetById
*/
fun getPetById(petId: kotlin.Long): Pet
fun updatePet(body: Pet): Unit
/**
* PUT /pet : Update an existing pet
*
* @param body Pet object that needs to be added to the store (required)
* @return Invalid ID supplied (status code 400)
* or Pet not found (status code 404)
* or Validation exception (status code 405)
* @see PetApi#updatePet
*/
fun updatePet(body: Pet): Unit
fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit
/**
* POST /pet/{petId} : Updates a pet in the store with form data
*
* @param petId ID of pet that needs to be updated (required)
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return Invalid input (status code 405)
* @see PetApi#updatePetWithForm
*/
fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse
/**
* POST /pet/{petId}/uploadImage : uploads an image
*
* @param petId ID of pet to update (required)
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return successful operation (status code 200)
* @see PetApi#uploadFile
*/
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse
}

View File

@@ -41,7 +41,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic
notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors")
@ApiResponses(
value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")])
@DeleteMapping(
@RequestMapping(
method = [RequestMethod.DELETE],
value = ["/store/order/{orderId}"]
)
fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: kotlin.String
@@ -58,7 +59,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic
authorizations = [Authorization(value = "api_key")])
@ApiResponses(
value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")])
@GetMapping(
@RequestMapping(
method = [RequestMethod.GET],
value = ["/store/inventory"],
produces = ["application/json"]
)
@@ -73,7 +75,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic
response = Order::class)
@ApiResponses(
value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")])
@GetMapping(
@RequestMapping(
method = [RequestMethod.GET],
value = ["/store/order/{orderId}"],
produces = ["application/xml", "application/json"]
)
@@ -89,7 +92,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic
response = Order::class)
@ApiResponses(
value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")])
@PostMapping(
@RequestMapping(
method = [RequestMethod.POST],
value = ["/store/order"],
produces = ["application/xml", "application/json"]
)

View File

@@ -1,13 +1,48 @@
package org.openapitools.api
import org.openapitools.model.Order
interface StoreApiService {
fun deleteOrder(orderId: kotlin.String): Unit
/**
* DELETE /store/order/{orderId} : Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
*
* @param orderId ID of the order that needs to be deleted (required)
* @return Invalid ID supplied (status code 400)
* or Order not found (status code 404)
* @see StoreApi#deleteOrder
*/
fun deleteOrder(orderId: kotlin.String): Unit
fun getInventory(): Map<String, kotlin.Int>
/**
* GET /store/inventory : Returns pet inventories by status
* Returns a map of status codes to quantities
*
* @return successful operation (status code 200)
* @see StoreApi#getInventory
*/
fun getInventory(): Map<String, kotlin.Int>
fun getOrderById(orderId: kotlin.Long): Order
/**
* GET /store/order/{orderId} : Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
*
* @param orderId ID of pet that needs to be fetched (required)
* @return successful operation (status code 200)
* or Invalid ID supplied (status code 400)
* or Order not found (status code 404)
* @see StoreApi#getOrderById
*/
fun getOrderById(orderId: kotlin.Long): Order
fun placeOrder(body: Order): Order
/**
* POST /store/order : Place an order for a pet
*
* @param body order placed for purchasing the pet (required)
* @return successful operation (status code 200)
* or Invalid Order (status code 400)
* @see StoreApi#placeOrder
*/
fun placeOrder(body: Order): Order
}

View File

@@ -41,7 +41,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
notes = "This can only be done by the logged in user.")
@ApiResponses(
value = [ApiResponse(code = 200, message = "successful operation")])
@PostMapping(
@RequestMapping(
method = [RequestMethod.POST],
value = ["/user"]
)
fun createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody body: User
@@ -55,7 +56,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
notes = "")
@ApiResponses(
value = [ApiResponse(code = 200, message = "successful operation")])
@PostMapping(
@RequestMapping(
method = [RequestMethod.POST],
value = ["/user/createWithArray"]
)
fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody body: kotlin.collections.List<User>
@@ -69,7 +71,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
notes = "")
@ApiResponses(
value = [ApiResponse(code = 200, message = "successful operation")])
@PostMapping(
@RequestMapping(
method = [RequestMethod.POST],
value = ["/user/createWithList"]
)
fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody body: kotlin.collections.List<User>
@@ -83,7 +86,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
notes = "This can only be done by the logged in user.")
@ApiResponses(
value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")])
@DeleteMapping(
@RequestMapping(
method = [RequestMethod.DELETE],
value = ["/user/{username}"]
)
fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: kotlin.String
@@ -98,7 +102,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
response = User::class)
@ApiResponses(
value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")])
@GetMapping(
@RequestMapping(
method = [RequestMethod.GET],
value = ["/user/{username}"],
produces = ["application/xml", "application/json"]
)
@@ -114,7 +119,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
response = kotlin.String::class)
@ApiResponses(
value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")])
@GetMapping(
@RequestMapping(
method = [RequestMethod.GET],
value = ["/user/login"],
produces = ["application/xml", "application/json"]
)
@@ -130,7 +136,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
notes = "")
@ApiResponses(
value = [ApiResponse(code = 200, message = "successful operation")])
@GetMapping(
@RequestMapping(
method = [RequestMethod.GET],
value = ["/user/logout"]
)
fun logoutUser(): ResponseEntity<Unit> {
@@ -143,7 +150,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
notes = "This can only be done by the logged in user.")
@ApiResponses(
value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")])
@PutMapping(
@RequestMapping(
method = [RequestMethod.PUT],
value = ["/user/{username}"]
)
fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: kotlin.String

View File

@@ -1,21 +1,87 @@
package org.openapitools.api
import org.openapitools.model.User
interface UserApiService {
fun createUser(body: User): Unit
/**
* POST /user : Create user
* This can only be done by the logged in user.
*
* @param body Created user object (required)
* @return successful operation (status code 200)
* @see UserApi#createUser
*/
fun createUser(body: User): Unit
fun createUsersWithArrayInput(body: kotlin.collections.List<User>): Unit
/**
* POST /user/createWithArray : Creates list of users with given input array
*
* @param body List of user object (required)
* @return successful operation (status code 200)
* @see UserApi#createUsersWithArrayInput
*/
fun createUsersWithArrayInput(body: kotlin.collections.List<User>): Unit
fun createUsersWithListInput(body: kotlin.collections.List<User>): Unit
/**
* POST /user/createWithList : Creates list of users with given input array
*
* @param body List of user object (required)
* @return successful operation (status code 200)
* @see UserApi#createUsersWithListInput
*/
fun createUsersWithListInput(body: kotlin.collections.List<User>): Unit
fun deleteUser(username: kotlin.String): Unit
/**
* DELETE /user/{username} : Delete user
* This can only be done by the logged in user.
*
* @param username The name that needs to be deleted (required)
* @return Invalid username supplied (status code 400)
* or User not found (status code 404)
* @see UserApi#deleteUser
*/
fun deleteUser(username: kotlin.String): Unit
fun getUserByName(username: kotlin.String): User
/**
* GET /user/{username} : Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing. (required)
* @return successful operation (status code 200)
* or Invalid username supplied (status code 400)
* or User not found (status code 404)
* @see UserApi#getUserByName
*/
fun getUserByName(username: kotlin.String): User
fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String
/**
* GET /user/login : Logs user into the system
*
* @param username The user name for login (required)
* @param password The password for login in clear text (required)
* @return successful operation (status code 200)
* or Invalid username/password supplied (status code 400)
* @see UserApi#loginUser
*/
fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String
fun logoutUser(): Unit
/**
* GET /user/logout : Logs out current logged in user session
*
* @return successful operation (status code 200)
* @see UserApi#logoutUser
*/
fun logoutUser(): Unit
fun updateUser(username: kotlin.String, body: User): Unit
/**
* PUT /user/{username} : Updated user
* This can only be done by the logged in user.
*
* @param username name that need to be deleted (required)
* @param body Updated user object (required)
* @return Invalid user supplied (status code 400)
* or User not found (status code 404)
* @see UserApi#updateUser
*/
fun updateUser(username: kotlin.String, body: User): Unit
}

View File

@@ -3,7 +3,6 @@ package org.openapitools.api
import org.openapitools.model.ModelApiResponse
import org.openapitools.model.Pet
import org.junit.jupiter.api.Test
import org.springframework.http.ResponseEntity
class PetApiTest {
@@ -11,138 +10,121 @@ class PetApiTest {
private val service: PetApiService = PetApiServiceImpl()
private val api: PetApiController = PetApiController(service)
/**
* Add a new pet to the store
*
*
*
* @throws ApiException
* if the Api call fails
*/
* To test PetApiController.addPet
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun addPetTest() {
val body:Pet? = null
val response: ResponseEntity<Unit> = api.addPet(body!!)
val body:Pet = TODO()
val response: ResponseEntity<Unit> = api.addPet(body)
// TODO: test validations
}
/**
* Deletes a pet
*
*
*
* @throws ApiException
* if the Api call fails
*/
* To test PetApiController.deletePet
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun deletePetTest() {
val petId:kotlin.Long? = null
val apiKey:kotlin.String? = null
val response: ResponseEntity<Unit> = api.deletePet(petId!!, apiKey!!)
val petId:kotlin.Long = TODO()
val apiKey:kotlin.String? = TODO()
val response: ResponseEntity<Unit> = api.deletePet(petId, apiKey)
// TODO: test validations
}
/**
* Finds Pets by status
*
* Multiple status values can be provided with comma separated strings
*
* @throws ApiException
* if the Api call fails
*/
* To test PetApiController.findPetsByStatus
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun findPetsByStatusTest() {
val status:kotlin.collections.List<kotlin.String>? = null
val response: ResponseEntity<List<Pet>> = api.findPetsByStatus(status!!)
val status:kotlin.collections.List<kotlin.String> = TODO()
val response: ResponseEntity<List<Pet>> = api.findPetsByStatus(status)
// TODO: test validations
}
/**
* Finds Pets by tags
*
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
*
* @throws ApiException
* if the Api call fails
*/
* To test PetApiController.findPetsByTags
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun findPetsByTagsTest() {
val tags:kotlin.collections.List<kotlin.String>? = null
val response: ResponseEntity<List<Pet>> = api.findPetsByTags(tags!!)
val tags:kotlin.collections.List<kotlin.String> = TODO()
val response: ResponseEntity<List<Pet>> = api.findPetsByTags(tags)
// TODO: test validations
}
/**
* Find pet by ID
*
* Returns a single pet
*
* @throws ApiException
* if the Api call fails
*/
* To test PetApiController.getPetById
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun getPetByIdTest() {
val petId:kotlin.Long? = null
val response: ResponseEntity<Pet> = api.getPetById(petId!!)
val petId:kotlin.Long = TODO()
val response: ResponseEntity<Pet> = api.getPetById(petId)
// TODO: test validations
}
/**
* Update an existing pet
*
*
*
* @throws ApiException
* if the Api call fails
*/
* To test PetApiController.updatePet
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun updatePetTest() {
val body:Pet? = null
val response: ResponseEntity<Unit> = api.updatePet(body!!)
val body:Pet = TODO()
val response: ResponseEntity<Unit> = api.updatePet(body)
// TODO: test validations
}
/**
* Updates a pet in the store with form data
*
*
*
* @throws ApiException
* if the Api call fails
*/
* To test PetApiController.updatePetWithForm
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun updatePetWithFormTest() {
val petId:kotlin.Long? = null
val name:kotlin.String? = null
val status:kotlin.String? = null
val response: ResponseEntity<Unit> = api.updatePetWithForm(petId!!, name!!, status!!)
val petId:kotlin.Long = TODO()
val name:kotlin.String? = TODO()
val status:kotlin.String? = TODO()
val response: ResponseEntity<Unit> = api.updatePetWithForm(petId, name, status)
// TODO: test validations
}
/**
* uploads an image
*
*
*
* @throws ApiException
* if the Api call fails
*/
* To test PetApiController.uploadFile
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun uploadFileTest() {
val petId:kotlin.Long? = null
val additionalMetadata:kotlin.String? = null
val file:org.springframework.core.io.Resource? = null
val response: ResponseEntity<ModelApiResponse> = api.uploadFile(petId!!, additionalMetadata!!, file!!)
val petId:kotlin.Long = TODO()
val additionalMetadata:kotlin.String? = TODO()
val file:org.springframework.core.io.Resource? = TODO()
val response: ResponseEntity<ModelApiResponse> = api.uploadFile(petId, additionalMetadata, file)
// TODO: test validations
}
}

View File

@@ -2,7 +2,6 @@ package org.openapitools.api
import org.openapitools.model.Order
import org.junit.jupiter.api.Test
import org.springframework.http.ResponseEntity
class StoreApiTest {
@@ -10,68 +9,59 @@ class StoreApiTest {
private val service: StoreApiService = StoreApiServiceImpl()
private val api: StoreApiController = StoreApiController(service)
/**
* Delete purchase order by ID
*
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
*
* @throws ApiException
* if the Api call fails
*/
* To test StoreApiController.deleteOrder
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun deleteOrderTest() {
val orderId:kotlin.String? = null
val response: ResponseEntity<Unit> = api.deleteOrder(orderId!!)
val orderId:kotlin.String = TODO()
val response: ResponseEntity<Unit> = api.deleteOrder(orderId)
// TODO: test validations
}
/**
* Returns pet inventories by status
*
* Returns a map of status codes to quantities
*
* @throws ApiException
* if the Api call fails
*/
* To test StoreApiController.getInventory
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun getInventoryTest() {
val response: ResponseEntity<Map<String, kotlin.Int>> = api.getInventory()
// TODO: test validations
}
/**
* Find purchase order by ID
*
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
*
* @throws ApiException
* if the Api call fails
*/
* To test StoreApiController.getOrderById
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun getOrderByIdTest() {
val orderId:kotlin.Long? = null
val response: ResponseEntity<Order> = api.getOrderById(orderId!!)
val orderId:kotlin.Long = TODO()
val response: ResponseEntity<Order> = api.getOrderById(orderId)
// TODO: test validations
}
/**
* Place an order for a pet
*
*
*
* @throws ApiException
* if the Api call fails
*/
* To test StoreApiController.placeOrder
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun placeOrderTest() {
val body:Order? = null
val response: ResponseEntity<Order> = api.placeOrder(body!!)
val body:Order = TODO()
val response: ResponseEntity<Order> = api.placeOrder(body)
// TODO: test validations
}
}

View File

@@ -2,7 +2,6 @@ package org.openapitools.api
import org.openapitools.model.User
import org.junit.jupiter.api.Test
import org.springframework.http.ResponseEntity
class UserApiTest {
@@ -10,134 +9,117 @@ class UserApiTest {
private val service: UserApiService = UserApiServiceImpl()
private val api: UserApiController = UserApiController(service)
/**
* Create user
*
* This can only be done by the logged in user.
*
* @throws ApiException
* if the Api call fails
*/
* To test UserApiController.createUser
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun createUserTest() {
val body:User? = null
val response: ResponseEntity<Unit> = api.createUser(body!!)
val body:User = TODO()
val response: ResponseEntity<Unit> = api.createUser(body)
// TODO: test validations
}
/**
* Creates list of users with given input array
*
*
*
* @throws ApiException
* if the Api call fails
*/
* To test UserApiController.createUsersWithArrayInput
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun createUsersWithArrayInputTest() {
val body:kotlin.collections.List<User>? = null
val response: ResponseEntity<Unit> = api.createUsersWithArrayInput(body!!)
val body:kotlin.collections.List<User> = TODO()
val response: ResponseEntity<Unit> = api.createUsersWithArrayInput(body)
// TODO: test validations
}
/**
* Creates list of users with given input array
*
*
*
* @throws ApiException
* if the Api call fails
*/
* To test UserApiController.createUsersWithListInput
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun createUsersWithListInputTest() {
val body:kotlin.collections.List<User>? = null
val response: ResponseEntity<Unit> = api.createUsersWithListInput(body!!)
val body:kotlin.collections.List<User> = TODO()
val response: ResponseEntity<Unit> = api.createUsersWithListInput(body)
// TODO: test validations
}
/**
* Delete user
*
* This can only be done by the logged in user.
*
* @throws ApiException
* if the Api call fails
*/
* To test UserApiController.deleteUser
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun deleteUserTest() {
val username:kotlin.String? = null
val response: ResponseEntity<Unit> = api.deleteUser(username!!)
val username:kotlin.String = TODO()
val response: ResponseEntity<Unit> = api.deleteUser(username)
// TODO: test validations
}
/**
* Get user by user name
*
*
*
* @throws ApiException
* if the Api call fails
*/
* To test UserApiController.getUserByName
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun getUserByNameTest() {
val username:kotlin.String? = null
val response: ResponseEntity<User> = api.getUserByName(username!!)
val username:kotlin.String = TODO()
val response: ResponseEntity<User> = api.getUserByName(username)
// TODO: test validations
}
/**
* Logs user into the system
*
*
*
* @throws ApiException
* if the Api call fails
*/
* To test UserApiController.loginUser
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun loginUserTest() {
val username:kotlin.String? = null
val password:kotlin.String? = null
val response: ResponseEntity<kotlin.String> = api.loginUser(username!!, password!!)
val username:kotlin.String = TODO()
val password:kotlin.String = TODO()
val response: ResponseEntity<kotlin.String> = api.loginUser(username, password)
// TODO: test validations
}
/**
* Logs out current logged in user session
*
*
*
* @throws ApiException
* if the Api call fails
*/
* To test UserApiController.logoutUser
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun logoutUserTest() {
val response: ResponseEntity<Unit> = api.logoutUser()
// TODO: test validations
}
/**
* Updated user
*
* This can only be done by the logged in user.
*
* @throws ApiException
* if the Api call fails
*/
* To test UserApiController.updateUser
*
* @throws ApiException
* if the Api call fails
*/
@Test
fun updateUserTest() {
val username:kotlin.String? = null
val body:User? = null
val response: ResponseEntity<Unit> = api.updateUser(username!!, body!!)
val username:kotlin.String = TODO()
val body:User = TODO()
val response: ResponseEntity<Unit> = api.updateUser(username, body)
// TODO: test validations
}
}