Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Integration tests for responses #42

Merged
merged 1 commit into from
Jul 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
827 changes: 824 additions & 3 deletions samples/junit-tests/junit_tests_specs.json

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
/**
* NOTE: This class is auto generated by the Swagger Gradle Codegen for the following API: JUnit Tests
*
* More info on this tool is available on https://github.com/Yelp/swagger-gradle-codegen
*/

package com.yelp.codegen.generatecodesamples.apis

import com.yelp.codegen.generatecodesamples.models.EmptyModel
import com.yelp.codegen.generatecodesamples.models.FormatResponses
import com.yelp.codegen.generatecodesamples.models.NestedAdditionalProperties
import com.yelp.codegen.generatecodesamples.models.NestedAdditionalPropertiesCustomDescription
import com.yelp.codegen.generatecodesamples.models.PropertyArray
import com.yelp.codegen.generatecodesamples.models.PropertyMap
import com.yelp.codegen.generatecodesamples.models.RequiredTypeResponses
import com.yelp.codegen.generatecodesamples.models.ReservedKeywords
import com.yelp.codegen.generatecodesamples.models.TopLevelEnum
import com.yelp.codegen.generatecodesamples.models.TopLevelMap
import com.yelp.codegen.generatecodesamples.models.TypeResponses
import io.reactivex.Completable
import io.reactivex.Single
import retrofit2.http.GET
import retrofit2.http.Headers

@JvmSuppressWildcards
interface ResourceApi {
/**
* Test brackets in parameter name
* Make sure that brackets in parameter name are treated properly
* The endpoint is owned by junittests service owner
* @param page (optional)
* @param page2 (optional)
* @param datePostedBefore (optional)
* @param datePostedStrictlyBefore (optional)
* @param datePostedAfter (optional)
* @param datePostedStrictlyAfter (optional)
*/
@Headers(
"X-Operation-ID: getBracketsInParameterName"
)

@GET("/brackets/in/parameter/name")
fun getBracketsInParameterName(
@retrofit2.http.Query("page") page: String?,
@retrofit2.http.Query("page[]") page2: String?,
@retrofit2.http.Query("datePosted[before]") datePostedBefore: String?,
@retrofit2.http.Query("datePosted[strictly_before]") datePostedStrictlyBefore: String?,
@retrofit2.http.Query("datePosted[after]") datePostedAfter: String?,
@retrofit2.http.Query("datePosted[strictly_after]") datePostedStrictlyAfter: String?
): Completable

/**
* The endpoint is owned by junittests service owner
*/
@Headers(
"X-Operation-ID: get_empty_endpoint"
)

@GET("/empty_endpoint")
fun getEmptyEndpoint(): Single<EmptyModel>

/**
* The endpoint is owned by junittests service owner
* @param propertyFormat (required)
*/
@Headers(
"X-Operation-ID: get_format_endpoint"
)

@GET("/format_endpoint/{property_format}")
fun getFormatEndpoint(
@retrofit2.http.Path("property_format") propertyFormat: String
): Single<FormatResponses>

/**
* The endpoint is owned by junittests service owner
*/
@Headers(
"X-Operation-ID: get_nested_additional_properties"
)

@GET("/nested_additional_properties")
fun getNestedAdditionalProperties(): Single<NestedAdditionalProperties>

/**
* The endpoint is owned by junittests service owner
*/
@Headers(
"X-Operation-ID: get_nested_additional_properties_custom_description"
)

@GET("/nested_additional_properties/custom_description")
fun getNestedAdditionalPropertiesCustomDescription(): Single<NestedAdditionalPropertiesCustomDescription>

/**
* The endpoint is owned by junittests service owner
* @param valueType (required)
* @param size (required)
*/
@Headers(
"X-Operation-ID: get_property_array"
)

@GET("/property_array/{value_type}/{size}")
fun getPropertyArray(
@retrofit2.http.Path("value_type") valueType: String,
@retrofit2.http.Path("size") size: String
): Single<PropertyArray>

/**
* The endpoint is owned by junittests service owner
* @param valueType (required)
* @param size (required)
*/
@Headers(
"X-Operation-ID: get_property_map"
)

@GET("/property_map/{value_type}/{size}")
fun getPropertyMap(
@retrofit2.http.Path("value_type") valueType: String,
@retrofit2.http.Path("size") size: String
): Single<PropertyMap>

/**
* The endpoint is owned by junittests service owner
*/
@Headers(
"X-Operation-ID: get_required_type_endpoint"
)

@GET("/required/type_endpoint")
fun getRequiredTypeEndpoint(): Single<RequiredTypeResponses>

/**
* The endpoint is owned by junittests service owner
*/
@Headers(
"X-Operation-ID: get_reserved_keywords"
)

@GET("/reserved_keywords")
fun getReservedKeywords(): Single<ReservedKeywords>

/**
* The endpoint is owned by junittests service owner
*/
@Headers(
"X-Operation-ID: get_top_level_enum"
)

@GET("/top_level_enum")
fun getTopLevelEnum(): Single<TopLevelEnum>

/**
* The endpoint is owned by junittests service owner
* @param size (required)
*/
@Headers(
"X-Operation-ID: get_top_level_map"
)

@GET("/top_level_map/{size}")
fun getTopLevelMap(
@retrofit2.http.Path("size") size: String
): Single<TopLevelMap>

/**
* The endpoint is owned by junittests service owner
* @param propertyType (required)
*/
@Headers(
"X-Operation-ID: get_type_endpoint"
)

@GET("/type_endpoint/{property_type}")
fun getTypeEndpoint(
@retrofit2.http.Path("property_type") propertyType: String
): Single<TypeResponses>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
/**
* NOTE: This class is auto generated by the Swagger Gradle Codegen for the following API: JUnit Tests
*
* More info on this tool is available on https://github.com/Yelp/swagger-gradle-codegen
*/

package com.yelp.codegen.generatecodesamples.apis

import com.yelp.codegen.generatecodesamples.models.XnullableFormatResponses
import com.yelp.codegen.generatecodesamples.models.XnullableNestedAdditionalProperties
import com.yelp.codegen.generatecodesamples.models.XnullablePropertyArray
import com.yelp.codegen.generatecodesamples.models.XnullablePropertyMap
import com.yelp.codegen.generatecodesamples.models.XnullableRequiredPropertyArray
import com.yelp.codegen.generatecodesamples.models.XnullableRequiredPropertyMap
import com.yelp.codegen.generatecodesamples.models.XnullableRequiredTypeResponses
import com.yelp.codegen.generatecodesamples.models.XnullableTypeResponses
import io.reactivex.Single
import retrofit2.http.GET
import retrofit2.http.Headers

@JvmSuppressWildcards
interface XnullableApi {
/**
* The endpoint is owned by junittests service owner
* @param propertyFormat (required)
*/
@Headers(
"X-Operation-ID: get_xnullable_format_endpoint"
)

@GET("/xnullable/format_endpoint/{property_format}")
fun getXnullableFormatEndpoint(
@retrofit2.http.Path("property_format") propertyFormat: String
): Single<XnullableFormatResponses>

/**
* The endpoint is owned by junittests service owner
*/
@Headers(
"X-Operation-ID: get_xnullable_nested_additional_properties"
)

@GET("/xnullable/nested_additional_properties")
fun getXnullableNestedAdditionalProperties(): Single<XnullableNestedAdditionalProperties>

/**
* The endpoint is owned by junittests service owner
* @param valueType (required)
* @param size (required)
*/
@Headers(
"X-Operation-ID: get_xnullable_property_array"
)

@GET("/xnullable/property_array/{value_type}/{size}")
fun getXnullablePropertyArray(
@retrofit2.http.Path("value_type") valueType: String,
@retrofit2.http.Path("size") size: String
): Single<XnullablePropertyArray>

/**
* The endpoint is owned by junittests service owner
* @param valueType (required)
* @param size (required)
*/
@Headers(
"X-Operation-ID: get_xnullable_property_map"
)

@GET("/xnullable/property_map/{value_type}/{size}")
fun getXnullablePropertyMap(
@retrofit2.http.Path("value_type") valueType: String,
@retrofit2.http.Path("size") size: String
): Single<XnullablePropertyMap>

/**
* The endpoint is owned by junittests service owner
* @param size (required)
*/
@Headers(
"X-Operation-ID: get_xnullable_required_property_array"
)

@GET("/xnullable/required/property_array/{size}")
fun getXnullableRequiredPropertyArray(
@retrofit2.http.Path("size") size: String
): Single<XnullableRequiredPropertyArray>

/**
* The endpoint is owned by junittests service owner
* @param size (required)
*/
@Headers(
"X-Operation-ID: get_xnullable_required_property_map"
)

@GET("/xnullable/required/property_map/{size}")
fun getXnullableRequiredPropertyMap(
@retrofit2.http.Path("size") size: String
): Single<XnullableRequiredPropertyMap>

/**
* The endpoint is owned by junittests service owner
* @param propertyType (required)
*/
@Headers(
"X-Operation-ID: get_xnullable_required_type_endpoint"
)

@GET("/xnullable/required/type_endpoint/{property_type}")
fun getXnullableRequiredTypeEndpoint(
@retrofit2.http.Path("property_type") propertyType: String
): Single<XnullableRequiredTypeResponses>

/**
* The endpoint is owned by junittests service owner
* @param propertyType (required)
*/
@Headers(
"X-Operation-ID: get_xnullable_type_endpoint"
)

@GET("/xnullable/type_endpoint/{property_type}")
fun getXnullableTypeEndpoint(
@retrofit2.http.Path("property_type") propertyType: String
): Single<XnullableTypeResponses>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* NOTE: This class is auto generated by the Swagger Gradle Codegen for the following API: JUnit Tests
*
* More info on this tool is available on https://github.com/Yelp/swagger-gradle-codegen
*/

package com.yelp.codegen.generatecodesamples.models

/**
*
*/
class EmptyModel
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* NOTE: This class is auto generated by the Swagger Gradle Codegen for the following API: JUnit Tests
*
* More info on this tool is available on https://github.com/Yelp/swagger-gradle-codegen
*/

package com.yelp.codegen.generatecodesamples.models

import com.squareup.moshi.Json
import org.threeten.bp.LocalDate
import org.threeten.bp.ZonedDateTime

/**
*
* @property dateProperty
* @property datetimeProperty
* @property enumProperty
*/
data class FormatResponses(
@Json(name = "date_property") @field:Json(name = "date_property") var dateProperty: LocalDate? = null,
@Json(name = "datetime_property") @field:Json(name = "datetime_property") var datetimeProperty: ZonedDateTime? = null,
@Json(name = "enum_property") @field:Json(name = "enum_property") var enumProperty: FormatResponses.EnumPropertyEnum? = null
) {
/**
*
* Values: VALUE1, VALUE2
*/
enum class EnumPropertyEnum(val value: String) {
@Json(name = "VALUE1") VALUE1("VALUE1"),
@Json(name = "VALUE2") VALUE2("VALUE2")
}
}
Loading