mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-04 11:26:09 +00:00
Add auto-generated test files for kotlin client (#17916)
* add auto-generated test files for kotlin client * undo changes to doc * add auto-generated model test files in kotlin clients * update tests
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
/**
|
||||
*
|
||||
* Please note:
|
||||
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
*/
|
||||
|
||||
@file:Suppress(
|
||||
"ArrayInDataClass",
|
||||
"EnumEntryName",
|
||||
"RemoveRedundantQualifierName",
|
||||
"UnusedImport"
|
||||
)
|
||||
|
||||
package org.openapitools.client.apis
|
||||
|
||||
import io.kotlintest.shouldBe
|
||||
import io.kotlintest.specs.ShouldSpec
|
||||
|
||||
import org.openapitools.client.apis.PetApi
|
||||
import org.openapitools.client.models.ModelApiResponse
|
||||
import org.openapitools.client.models.Pet
|
||||
|
||||
class PetApiTest : ShouldSpec() {
|
||||
init {
|
||||
// uncomment below to create an instance of PetApi
|
||||
//val apiInstance = PetApi()
|
||||
|
||||
// to test addPet
|
||||
should("test addPet") {
|
||||
// uncomment below to test addPet
|
||||
//val pet : Pet = // Pet | Pet object that needs to be added to the store
|
||||
//val result : Pet = apiInstance.addPet(pet)
|
||||
//result shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test deletePet
|
||||
should("test deletePet") {
|
||||
// uncomment below to test deletePet
|
||||
//val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete
|
||||
//val apiKey : kotlin.String = apiKey_example // kotlin.String |
|
||||
//apiInstance.deletePet(petId, apiKey)
|
||||
}
|
||||
|
||||
// to test findPetsByStatus
|
||||
should("test findPetsByStatus") {
|
||||
// uncomment below to test findPetsByStatus
|
||||
//val status : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Status values that need to be considered for filter
|
||||
//val result : kotlin.collections.List<Pet> = apiInstance.findPetsByStatus(status)
|
||||
//result shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test findPetsByTags
|
||||
should("test findPetsByTags") {
|
||||
// uncomment below to test findPetsByTags
|
||||
//val tags : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Tags to filter by
|
||||
//val result : kotlin.collections.List<Pet> = apiInstance.findPetsByTags(tags)
|
||||
//result shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test getPetById
|
||||
should("test getPetById") {
|
||||
// uncomment below to test getPetById
|
||||
//val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return
|
||||
//val result : Pet = apiInstance.getPetById(petId)
|
||||
//result shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test updatePet
|
||||
should("test updatePet") {
|
||||
// uncomment below to test updatePet
|
||||
//val pet : Pet = // Pet | Pet object that needs to be added to the store
|
||||
//val result : Pet = apiInstance.updatePet(pet)
|
||||
//result shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test updatePetWithForm
|
||||
should("test updatePetWithForm") {
|
||||
// uncomment below to test updatePetWithForm
|
||||
//val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated
|
||||
//val name : kotlin.String = name_example // kotlin.String | Updated name of the pet
|
||||
//val status : kotlin.String = status_example // kotlin.String | Updated status of the pet
|
||||
//apiInstance.updatePetWithForm(petId, name, status)
|
||||
}
|
||||
|
||||
// to test uploadFile
|
||||
should("test uploadFile") {
|
||||
// uncomment below to test uploadFile
|
||||
//val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update
|
||||
//val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server
|
||||
//val file : io.ktor.client.request.forms.InputProvider = BINARY_DATA_HERE // io.ktor.client.request.forms.InputProvider | file to upload
|
||||
//val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file)
|
||||
//result shouldBe ("TODO")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
*
|
||||
* Please note:
|
||||
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
*/
|
||||
|
||||
@file:Suppress(
|
||||
"ArrayInDataClass",
|
||||
"EnumEntryName",
|
||||
"RemoveRedundantQualifierName",
|
||||
"UnusedImport"
|
||||
)
|
||||
|
||||
package org.openapitools.client.apis
|
||||
|
||||
import io.kotlintest.shouldBe
|
||||
import io.kotlintest.specs.ShouldSpec
|
||||
|
||||
import org.openapitools.client.apis.StoreApi
|
||||
import org.openapitools.client.models.Order
|
||||
|
||||
class StoreApiTest : ShouldSpec() {
|
||||
init {
|
||||
// uncomment below to create an instance of StoreApi
|
||||
//val apiInstance = StoreApi()
|
||||
|
||||
// to test deleteOrder
|
||||
should("test deleteOrder") {
|
||||
// uncomment below to test deleteOrder
|
||||
//val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted
|
||||
//apiInstance.deleteOrder(orderId)
|
||||
}
|
||||
|
||||
// to test getInventory
|
||||
should("test getInventory") {
|
||||
// uncomment below to test getInventory
|
||||
//val result : kotlin.collections.Map<kotlin.String, kotlin.Int> = apiInstance.getInventory()
|
||||
//result shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test getOrderById
|
||||
should("test getOrderById") {
|
||||
// uncomment below to test getOrderById
|
||||
//val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched
|
||||
//val result : Order = apiInstance.getOrderById(orderId)
|
||||
//result shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test placeOrder
|
||||
should("test placeOrder") {
|
||||
// uncomment below to test placeOrder
|
||||
//val order : Order = // Order | order placed for purchasing the pet
|
||||
//val result : Order = apiInstance.placeOrder(order)
|
||||
//result shouldBe ("TODO")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/**
|
||||
*
|
||||
* Please note:
|
||||
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
*/
|
||||
|
||||
@file:Suppress(
|
||||
"ArrayInDataClass",
|
||||
"EnumEntryName",
|
||||
"RemoveRedundantQualifierName",
|
||||
"UnusedImport"
|
||||
)
|
||||
|
||||
package org.openapitools.client.apis
|
||||
|
||||
import io.kotlintest.shouldBe
|
||||
import io.kotlintest.specs.ShouldSpec
|
||||
|
||||
import org.openapitools.client.apis.UserApi
|
||||
import org.openapitools.client.models.User
|
||||
|
||||
class UserApiTest : ShouldSpec() {
|
||||
init {
|
||||
// uncomment below to create an instance of UserApi
|
||||
//val apiInstance = UserApi()
|
||||
|
||||
// to test createUser
|
||||
should("test createUser") {
|
||||
// uncomment below to test createUser
|
||||
//val user : User = // User | Created user object
|
||||
//apiInstance.createUser(user)
|
||||
}
|
||||
|
||||
// to test createUsersWithArrayInput
|
||||
should("test createUsersWithArrayInput") {
|
||||
// uncomment below to test createUsersWithArrayInput
|
||||
//val user : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
|
||||
//apiInstance.createUsersWithArrayInput(user)
|
||||
}
|
||||
|
||||
// to test createUsersWithListInput
|
||||
should("test createUsersWithListInput") {
|
||||
// uncomment below to test createUsersWithListInput
|
||||
//val user : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
|
||||
//apiInstance.createUsersWithListInput(user)
|
||||
}
|
||||
|
||||
// to test deleteUser
|
||||
should("test deleteUser") {
|
||||
// uncomment below to test deleteUser
|
||||
//val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted
|
||||
//apiInstance.deleteUser(username)
|
||||
}
|
||||
|
||||
// to test getUserByName
|
||||
should("test getUserByName") {
|
||||
// uncomment below to test getUserByName
|
||||
//val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing.
|
||||
//val result : User = apiInstance.getUserByName(username)
|
||||
//result shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test loginUser
|
||||
should("test loginUser") {
|
||||
// uncomment below to test loginUser
|
||||
//val username : kotlin.String = username_example // kotlin.String | The user name for login
|
||||
//val password : kotlin.String = password_example // kotlin.String | The password for login in clear text
|
||||
//val result : kotlin.String = apiInstance.loginUser(username, password)
|
||||
//result shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test logoutUser
|
||||
should("test logoutUser") {
|
||||
// uncomment below to test logoutUser
|
||||
//apiInstance.logoutUser()
|
||||
}
|
||||
|
||||
// to test updateUser
|
||||
should("test updateUser") {
|
||||
// uncomment below to test updateUser
|
||||
//val username : kotlin.String = username_example // kotlin.String | name that need to be deleted
|
||||
//val user : User = // User | Updated user object
|
||||
//apiInstance.updateUser(username, user)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
*
|
||||
* Please note:
|
||||
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
*/
|
||||
|
||||
@file:Suppress(
|
||||
"ArrayInDataClass",
|
||||
"EnumEntryName",
|
||||
"RemoveRedundantQualifierName",
|
||||
"UnusedImport"
|
||||
)
|
||||
|
||||
package org.openapitools.client.models
|
||||
|
||||
import io.kotlintest.shouldBe
|
||||
import io.kotlintest.specs.ShouldSpec
|
||||
|
||||
import org.openapitools.client.models.ModelApiResponse
|
||||
|
||||
class ModelApiResponseTest : ShouldSpec() {
|
||||
init {
|
||||
// uncomment below to create an instance of ModelApiResponse
|
||||
//val modelInstance = ModelApiResponse()
|
||||
|
||||
// to test the property `code`
|
||||
should("test code") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.code shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `type`
|
||||
should("test type") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.type shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `message`
|
||||
should("test message") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.message shouldBe ("TODO")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
*
|
||||
* Please note:
|
||||
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
*/
|
||||
|
||||
@file:Suppress(
|
||||
"ArrayInDataClass",
|
||||
"EnumEntryName",
|
||||
"RemoveRedundantQualifierName",
|
||||
"UnusedImport"
|
||||
)
|
||||
|
||||
package org.openapitools.client.models
|
||||
|
||||
import io.kotlintest.shouldBe
|
||||
import io.kotlintest.specs.ShouldSpec
|
||||
|
||||
import org.openapitools.client.models.Category
|
||||
|
||||
class CategoryTest : ShouldSpec() {
|
||||
init {
|
||||
// uncomment below to create an instance of Category
|
||||
//val modelInstance = Category()
|
||||
|
||||
// to test the property `id`
|
||||
should("test id") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.id shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `name`
|
||||
should("test name") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.name shouldBe ("TODO")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
*
|
||||
* Please note:
|
||||
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
*/
|
||||
|
||||
@file:Suppress(
|
||||
"ArrayInDataClass",
|
||||
"EnumEntryName",
|
||||
"RemoveRedundantQualifierName",
|
||||
"UnusedImport"
|
||||
)
|
||||
|
||||
package org.openapitools.client.models
|
||||
|
||||
import io.kotlintest.shouldBe
|
||||
import io.kotlintest.specs.ShouldSpec
|
||||
|
||||
import org.openapitools.client.models.Order
|
||||
|
||||
class OrderTest : ShouldSpec() {
|
||||
init {
|
||||
// uncomment below to create an instance of Order
|
||||
//val modelInstance = Order()
|
||||
|
||||
// to test the property `id`
|
||||
should("test id") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.id shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `petId`
|
||||
should("test petId") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.petId shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `quantity`
|
||||
should("test quantity") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.quantity shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `shipDate`
|
||||
should("test shipDate") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.shipDate shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `status` - Order Status
|
||||
should("test status") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.status shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `complete`
|
||||
should("test complete") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.complete shouldBe ("TODO")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
*
|
||||
* Please note:
|
||||
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
*/
|
||||
|
||||
@file:Suppress(
|
||||
"ArrayInDataClass",
|
||||
"EnumEntryName",
|
||||
"RemoveRedundantQualifierName",
|
||||
"UnusedImport"
|
||||
)
|
||||
|
||||
package org.openapitools.client.models
|
||||
|
||||
import io.kotlintest.shouldBe
|
||||
import io.kotlintest.specs.ShouldSpec
|
||||
|
||||
import org.openapitools.client.models.Pet
|
||||
import org.openapitools.client.models.Category
|
||||
import org.openapitools.client.models.Tag
|
||||
|
||||
class PetTest : ShouldSpec() {
|
||||
init {
|
||||
// uncomment below to create an instance of Pet
|
||||
//val modelInstance = Pet()
|
||||
|
||||
// to test the property `name`
|
||||
should("test name") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.name shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `photoUrls`
|
||||
should("test photoUrls") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.photoUrls shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `id`
|
||||
should("test id") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.id shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `category`
|
||||
should("test category") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.category shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `tags`
|
||||
should("test tags") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.tags shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `status` - pet status in the store
|
||||
should("test status") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.status shouldBe ("TODO")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
*
|
||||
* Please note:
|
||||
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
*/
|
||||
|
||||
@file:Suppress(
|
||||
"ArrayInDataClass",
|
||||
"EnumEntryName",
|
||||
"RemoveRedundantQualifierName",
|
||||
"UnusedImport"
|
||||
)
|
||||
|
||||
package org.openapitools.client.models
|
||||
|
||||
import io.kotlintest.shouldBe
|
||||
import io.kotlintest.specs.ShouldSpec
|
||||
|
||||
import org.openapitools.client.models.Tag
|
||||
|
||||
class TagTest : ShouldSpec() {
|
||||
init {
|
||||
// uncomment below to create an instance of Tag
|
||||
//val modelInstance = Tag()
|
||||
|
||||
// to test the property `id`
|
||||
should("test id") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.id shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `name`
|
||||
should("test name") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.name shouldBe ("TODO")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
*
|
||||
* Please note:
|
||||
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
*/
|
||||
|
||||
@file:Suppress(
|
||||
"ArrayInDataClass",
|
||||
"EnumEntryName",
|
||||
"RemoveRedundantQualifierName",
|
||||
"UnusedImport"
|
||||
)
|
||||
|
||||
package org.openapitools.client.models
|
||||
|
||||
import io.kotlintest.shouldBe
|
||||
import io.kotlintest.specs.ShouldSpec
|
||||
|
||||
import org.openapitools.client.models.User
|
||||
|
||||
class UserTest : ShouldSpec() {
|
||||
init {
|
||||
// uncomment below to create an instance of User
|
||||
//val modelInstance = User()
|
||||
|
||||
// to test the property `id`
|
||||
should("test id") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.id shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `username`
|
||||
should("test username") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.username shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `firstName`
|
||||
should("test firstName") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.firstName shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `lastName`
|
||||
should("test lastName") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.lastName shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `email`
|
||||
should("test email") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.email shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `password`
|
||||
should("test password") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.password shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `phone`
|
||||
should("test phone") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.phone shouldBe ("TODO")
|
||||
}
|
||||
|
||||
// to test the property `userStatus` - User Status
|
||||
should("test userStatus") {
|
||||
// uncomment below to test the property
|
||||
//modelInstance.userStatus shouldBe ("TODO")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user