From e9a0d7ea8367aee9322838c7d78ed5a2ae9ac74a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Petersen?= Date: Fri, 9 Jun 2017 10:16:53 +0200 Subject: [PATCH] Add android dependency to pom if 'parcelableModel' is set (#5801) (#5802) * Add android dependency to pom if 'parcelableModel' is set * Update java-okhttp-gson-parcelableModel sample --- .../Java/libraries/okhttp-gson/pom.mustache | 9 ++ .../Java/libraries/retrofit/pom.mustache | 10 ++ .../Java/libraries/retrofit2/pom.mustache | 10 ++ .../src/main/resources/Java/pom.mustache | 11 ++ .../okhttp-gson-parcelableModel/README.md | 47 ++++--- .../docs/FakeclassnametagsApi.md | 52 -------- .../java/okhttp-gson-parcelableModel/pom.xml | 7 + .../swagger/client/ProgressRequestBody.java | 8 +- .../io/swagger/client/api/FakeApiTest.java | 123 ++++++++++++++---- .../client/api/FakeclassnametagsApiTest.java | 61 --------- .../io/swagger/client/api/PetApiTest.java | 34 ++--- .../io/swagger/client/api/StoreApiTest.java | 24 +--- .../io/swagger/client/api/UserApiTest.java | 32 ++--- 13 files changed, 205 insertions(+), 223 deletions(-) delete mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeclassnametagsApi.md delete mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeclassnametagsApiTest.java diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache index 40ec4f345e3..d8086d4550f 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache @@ -218,6 +218,15 @@ 2.2 {{/performBeanValidation}} + {{#parcelableModel}} + + + com.google.android + android + 4.1.1.4 + provided + + {{/parcelableModel}} junit diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache index b5b7a535a4f..13f1ac3282b 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache @@ -203,6 +203,16 @@ ${jodatime-version} + {{#parcelableModel}} + + + com.google.android + android + 4.1.1.4 + provided + + {{/parcelableModel}} + junit diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache index 2bcbdd3fa11..92002db838e 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache @@ -260,6 +260,16 @@ {{/usePlay24WS}} + {{#parcelableModel}} + + + com.google.android + android + 4.1.1.4 + provided + + {{/parcelableModel}} + junit diff --git a/modules/swagger-codegen/src/main/resources/Java/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/pom.mustache index 67d4ba4d2ac..9a292b9ddc4 100644 --- a/modules/swagger-codegen/src/main/resources/Java/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/pom.mustache @@ -272,6 +272,17 @@ provided {{/useBeanValidation}} + + {{#parcelableModel}} + + + com.google.android + android + 4.1.1.4 + provided + + {{/parcelableModel}} + junit diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md index ce4c6f54fa4..8e55bbc51a2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md @@ -71,22 +71,12 @@ public class FakeApiExample { public static void main(String[] args) { FakeApi apiInstance = new FakeApi(); - BigDecimal number = new BigDecimal(); // BigDecimal | None - Double _double = 3.4D; // Double | None - String string = "string_example"; // String | None - byte[] _byte = B; // byte[] | None - Integer integer = 56; // Integer | None - Integer int32 = 56; // Integer | None - Long int64 = 789L; // Long | None - Float _float = 3.4F; // Float | None - byte[] binary = B; // byte[] | None - LocalDate date = new LocalDate(); // LocalDate | None - DateTime dateTime = new DateTime(); // DateTime | None - String password = "password_example"; // String | None + Boolean body = true; // Boolean | Input boolean as post body try { - apiInstance.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testEndpointParameters"); + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); e.printStackTrace(); } } @@ -96,12 +86,17 @@ public class FakeApiExample { ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**testEnumQueryParameters**](docs/FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters +*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status @@ -110,9 +105,9 @@ Class | Method | HTTP request | Description *PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet *PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet *UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user *UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array @@ -132,9 +127,11 @@ Class | Method | HTTP request | Description - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) - - [Cat](docs/Cat.md) + - [Capitalization](docs/Capitalization.md) - [Category](docs/Category.md) - - [Dog](docs/Dog.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [EnumArrays](docs/EnumArrays.md) - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) - [FormatTest](docs/FormatTest.md) @@ -147,11 +144,15 @@ Class | Method | HTTP request | Description - [Name](docs/Name.md) - [NumberOnly](docs/NumberOnly.md) - [Order](docs/Order.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) + - [Cat](docs/Cat.md) + - [Dog](docs/Dog.md) ## Documentation for Authorization @@ -163,6 +164,10 @@ Authentication schemes defined for the API: - **API key parameter name**: api_key - **Location**: HTTP header +### http_basic_test + +- **Type**: HTTP basic authentication + ### petstore_auth - **Type**: OAuth @@ -175,7 +180,7 @@ Authentication schemes defined for the API: ## Recommendation -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issue. +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. ## Author diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeclassnametagsApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeclassnametagsApi.md deleted file mode 100644 index f8ec0768e1f..00000000000 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeclassnametagsApi.md +++ /dev/null @@ -1,52 +0,0 @@ -# FakeclassnametagsApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeclassnametagsApi.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case - - - -# **testClassname** -> Client testClassname(body) - -To test class name in snake case - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeclassnametagsApi; - - -FakeclassnametagsApi apiInstance = new FakeclassnametagsApi(); -Client body = new Client(); // Client | client model -try { - Client result = apiInstance.testClassname(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling FakeclassnametagsApi#testClassname"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml index 26751c4e3af..751d978c946 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml @@ -194,6 +194,13 @@ joda-time ${jodatime-version} + + + com.google.android + android + 4.1.1.4 + provided + junit diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ProgressRequestBody.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ProgressRequestBody.java index a06ea04a4d0..d6d76e7de98 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ProgressRequestBody.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ProgressRequestBody.java @@ -34,8 +34,6 @@ public class ProgressRequestBody extends RequestBody { private final ProgressRequestListener progressListener; - private BufferedSink bufferedSink; - public ProgressRequestBody(RequestBody requestBody, ProgressRequestListener progressListener) { this.requestBody = requestBody; this.progressListener = progressListener; @@ -53,13 +51,9 @@ public class ProgressRequestBody extends RequestBody { @Override public void writeTo(BufferedSink sink) throws IOException { - if (bufferedSink == null) { - bufferedSink = Okio.buffer(sink(sink)); - } - + BufferedSink bufferedSink = Okio.buffer(sink(sink)); requestBody.writeTo(bufferedSink); bufferedSink.flush(); - } private Sink sink(Sink sink) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeApiTest.java index 5a7d2e5aa80..169209bd418 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -1,4 +1,4 @@ -/** +/* * Swagger Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * @@ -8,28 +8,19 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ package io.swagger.client.api; import io.swagger.client.ApiException; -import org.joda.time.LocalDate; -import org.joda.time.DateTime; import java.math.BigDecimal; +import io.swagger.client.model.Client; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import io.swagger.client.model.OuterComposite; import org.junit.Test; +import org.junit.Ignore; import java.util.ArrayList; import java.util.HashMap; @@ -39,11 +30,92 @@ import java.util.Map; /** * API tests for FakeApi */ +@Ignore public class FakeApiTest { private final FakeApi api = new FakeApi(); + /** + * + * + * Test serialization of outer boolean types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterBooleanSerializeTest() throws ApiException { + Boolean body = null; + Boolean response = api.fakeOuterBooleanSerialize(body); + + // TODO: test validations + } + + /** + * + * + * Test serialization of object with outer number type + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterCompositeSerializeTest() throws ApiException { + OuterComposite body = null; + OuterComposite response = api.fakeOuterCompositeSerialize(body); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer number types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterNumberSerializeTest() throws ApiException { + BigDecimal body = null; + BigDecimal response = api.fakeOuterNumberSerialize(body); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer string types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterStringSerializeTest() throws ApiException { + String body = null; + String response = api.fakeOuterStringSerialize(body); + + // TODO: test validations + } + + /** + * To test \"client\" model + * + * To test \"client\" model + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClientModelTest() throws ApiException { + Client body = null; + Client response = api.testClientModel(body); + + // TODO: test validations + } + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @@ -56,35 +128,42 @@ public class FakeApiTest { public void testEndpointParametersTest() throws ApiException { BigDecimal number = null; Double _double = null; - String string = null; + String patternWithoutDelimiter = null; byte[] _byte = null; Integer integer = null; Integer int32 = null; Long int64 = null; Float _float = null; + String string = null; byte[] binary = null; LocalDate date = null; DateTime dateTime = null; String password = null; - // api.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); + String paramCallback = null; + api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); // TODO: test validations } /** - * To test enum query parameters + * To test enum parameters * - * + * To test enum parameters * * @throws ApiException * if the Api call fails */ @Test - public void testEnumQueryParametersTest() throws ApiException { + public void testEnumParametersTest() throws ApiException { + List enumFormStringArray = null; + String enumFormString = null; + List enumHeaderStringArray = null; + String enumHeaderString = null; + List enumQueryStringArray = null; String enumQueryString = null; - BigDecimal enumQueryInteger = null; + Integer enumQueryInteger = null; Double enumQueryDouble = null; - // api.testEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble); + api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); // TODO: test validations } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeclassnametagsApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeclassnametagsApiTest.java deleted file mode 100644 index 0d9a4c99b27..00000000000 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeclassnametagsApiTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package io.swagger.client.api; - -import io.swagger.client.ApiException; -import io.swagger.client.model.Client; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for FakeclassnametagsApi - */ -public class FakeclassnametagsApiTest { - - private final FakeclassnametagsApi api = new FakeclassnametagsApi(); - - - /** - * To test class name in snake case - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testClassnameTest() throws ApiException { - Client body = null; - // Client response = api.testClassname(body); - - // TODO: test validations - } - -} diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/PetApiTest.java index 373f7d287ad..349a55d93dc 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/PetApiTest.java @@ -1,4 +1,4 @@ -/** +/* * Swagger Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * @@ -8,28 +8,17 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ package io.swagger.client.api; import io.swagger.client.ApiException; -import io.swagger.client.model.Pet; import java.io.File; import io.swagger.client.model.ModelApiResponse; +import io.swagger.client.model.Pet; import org.junit.Test; +import org.junit.Ignore; import java.util.ArrayList; import java.util.HashMap; @@ -39,6 +28,7 @@ import java.util.Map; /** * API tests for PetApi */ +@Ignore public class PetApiTest { private final PetApi api = new PetApi(); @@ -55,7 +45,7 @@ public class PetApiTest { @Test public void addPetTest() throws ApiException { Pet body = null; - // api.addPet(body); + api.addPet(body); // TODO: test validations } @@ -72,7 +62,7 @@ public class PetApiTest { public void deletePetTest() throws ApiException { Long petId = null; String apiKey = null; - // api.deletePet(petId, apiKey); + api.deletePet(petId, apiKey); // TODO: test validations } @@ -88,7 +78,7 @@ public class PetApiTest { @Test public void findPetsByStatusTest() throws ApiException { List status = null; - // List response = api.findPetsByStatus(status); + List response = api.findPetsByStatus(status); // TODO: test validations } @@ -104,7 +94,7 @@ public class PetApiTest { @Test public void findPetsByTagsTest() throws ApiException { List tags = null; - // List response = api.findPetsByTags(tags); + List response = api.findPetsByTags(tags); // TODO: test validations } @@ -120,7 +110,7 @@ public class PetApiTest { @Test public void getPetByIdTest() throws ApiException { Long petId = null; - // Pet response = api.getPetById(petId); + Pet response = api.getPetById(petId); // TODO: test validations } @@ -136,7 +126,7 @@ public class PetApiTest { @Test public void updatePetTest() throws ApiException { Pet body = null; - // api.updatePet(body); + api.updatePet(body); // TODO: test validations } @@ -154,7 +144,7 @@ public class PetApiTest { Long petId = null; String name = null; String status = null; - // api.updatePetWithForm(petId, name, status); + api.updatePetWithForm(petId, name, status); // TODO: test validations } @@ -172,7 +162,7 @@ public class PetApiTest { Long petId = null; String additionalMetadata = null; File file = null; - // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); // TODO: test validations } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/StoreApiTest.java index 4bcdcbf8338..bef0884a2da 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -1,4 +1,4 @@ -/** +/* * Swagger Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * @@ -8,18 +8,6 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ @@ -28,6 +16,7 @@ package io.swagger.client.api; import io.swagger.client.ApiException; import io.swagger.client.model.Order; import org.junit.Test; +import org.junit.Ignore; import java.util.ArrayList; import java.util.HashMap; @@ -37,6 +26,7 @@ import java.util.Map; /** * API tests for StoreApi */ +@Ignore public class StoreApiTest { private final StoreApi api = new StoreApi(); @@ -53,7 +43,7 @@ public class StoreApiTest { @Test public void deleteOrderTest() throws ApiException { String orderId = null; - // api.deleteOrder(orderId); + api.deleteOrder(orderId); // TODO: test validations } @@ -68,7 +58,7 @@ public class StoreApiTest { */ @Test public void getInventoryTest() throws ApiException { - // Map response = api.getInventory(); + Map response = api.getInventory(); // TODO: test validations } @@ -84,7 +74,7 @@ public class StoreApiTest { @Test public void getOrderByIdTest() throws ApiException { Long orderId = null; - // Order response = api.getOrderById(orderId); + Order response = api.getOrderById(orderId); // TODO: test validations } @@ -100,7 +90,7 @@ public class StoreApiTest { @Test public void placeOrderTest() throws ApiException { Order body = null; - // Order response = api.placeOrder(body); + Order response = api.placeOrder(body); // TODO: test validations } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/UserApiTest.java index 832748dbb45..4455b3920b9 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/UserApiTest.java @@ -1,4 +1,4 @@ -/** +/* * Swagger Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * @@ -8,18 +8,6 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ @@ -28,6 +16,7 @@ package io.swagger.client.api; import io.swagger.client.ApiException; import io.swagger.client.model.User; import org.junit.Test; +import org.junit.Ignore; import java.util.ArrayList; import java.util.HashMap; @@ -37,6 +26,7 @@ import java.util.Map; /** * API tests for UserApi */ +@Ignore public class UserApiTest { private final UserApi api = new UserApi(); @@ -53,7 +43,7 @@ public class UserApiTest { @Test public void createUserTest() throws ApiException { User body = null; - // api.createUser(body); + api.createUser(body); // TODO: test validations } @@ -69,7 +59,7 @@ public class UserApiTest { @Test public void createUsersWithArrayInputTest() throws ApiException { List body = null; - // api.createUsersWithArrayInput(body); + api.createUsersWithArrayInput(body); // TODO: test validations } @@ -85,7 +75,7 @@ public class UserApiTest { @Test public void createUsersWithListInputTest() throws ApiException { List body = null; - // api.createUsersWithListInput(body); + api.createUsersWithListInput(body); // TODO: test validations } @@ -101,7 +91,7 @@ public class UserApiTest { @Test public void deleteUserTest() throws ApiException { String username = null; - // api.deleteUser(username); + api.deleteUser(username); // TODO: test validations } @@ -117,7 +107,7 @@ public class UserApiTest { @Test public void getUserByNameTest() throws ApiException { String username = null; - // User response = api.getUserByName(username); + User response = api.getUserByName(username); // TODO: test validations } @@ -134,7 +124,7 @@ public class UserApiTest { public void loginUserTest() throws ApiException { String username = null; String password = null; - // String response = api.loginUser(username, password); + String response = api.loginUser(username, password); // TODO: test validations } @@ -149,7 +139,7 @@ public class UserApiTest { */ @Test public void logoutUserTest() throws ApiException { - // api.logoutUser(); + api.logoutUser(); // TODO: test validations } @@ -166,7 +156,7 @@ public class UserApiTest { public void updateUserTest() throws ApiException { String username = null; User body = null; - // api.updateUser(username, body); + api.updateUser(username, body); // TODO: test validations }