[Java][okhttp-gson] update junit to 5.8.2 from 4.13.2 (#11882)

* update junit to 5.8.2 in java okhttp-gson client

* undo changes to yaml

* update samples

* update tests

* fix indentation

* restore tests

* update samples
This commit is contained in:
William Cheng
2022-03-16 16:33:47 +08:00
committed by GitHub
parent 4e602b66b9
commit 9a1e6d778a
158 changed files with 789 additions and 805 deletions

View File

@@ -5,8 +5,8 @@ package {{package}};
import {{invokerPackage}}.ApiException;
{{#imports}}import {{import}};
{{/imports}}
import org.junit.Test;
import org.junit.Ignore;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
{{^fullJavaUtil}}
import java.util.ArrayList;
@@ -21,19 +21,23 @@ import java.io.InputStream;
/**
* API tests for {{classname}}
*/
@Ignore
@Disabled
public class {{classname}}Test {
private final {{classname}} api = new {{classname}}();
{{#operations}}{{#operation}}
{{#operations}}
{{#operation}}
/**
{{#summary}}
* {{summary}}
*
{{/summary}}
{{#notes}}
* {{notes}}
*
* @throws ApiException
* if the Api call fails
{{/notes}}
* @throws ApiException if the Api call fails
*/
@Test
public void {{operationId}}Test() throws ApiException {
@@ -52,5 +56,7 @@ public class {{classname}}Test {
{{/vendorExtensions.x-streaming}}
// TODO: test validations
}
{{/operation}}{{/operations}}
{{/operation}}
{{/operations}}
}

View File

@@ -0,0 +1,49 @@
{{>licenseInfo}}
package {{package}};
{{#imports}}import {{import}};
{{/imports}}
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
{{#fullJavaUtil}}
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
{{/fullJavaUtil}}
/**
* Model tests for {{classname}}
*/
public class {{classname}}Test {
{{#models}}
{{#model}}
{{^vendorExtensions.x-is-one-of-interface}}
{{^isEnum}}
private final {{classname}} model = new {{classname}}();
{{/isEnum}}
/**
* Model tests for {{classname}}
*/
@Test
public void test{{classname}}() {
// TODO: test {{classname}}
}
{{#allVars}}
/**
* Test the property '{{name}}'
*/
@Test
public void {{name}}Test() {
// TODO: test {{name}}
}
{{/allVars}}
{{/vendorExtensions.x-is-one-of-interface}}
{{/model}}
{{/models}}
}

View File

@@ -369,8 +369,8 @@
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
@@ -403,7 +403,7 @@
{{#useBeanValidation}}
<beanvalidation-version>2.0.2</beanvalidation-version>
{{/useBeanValidation}}
<junit-version>4.13.2</junit-version>
<junit-version>5.8.2</junit-version>
<mockito-core-version>3.12.4</mockito-core-version>
<javax.ws.rs-api-version>2.1.1</javax.ws.rs-api-version>
<jsr311-api-version>1.1.1</jsr311-api-version>

View File

@@ -308,8 +308,8 @@
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
@@ -331,7 +331,7 @@
<commons-lang3-version>3.12.0</commons-lang3-version>
<jackson-databind-nullable-version>0.2.2</jackson-databind-nullable-version>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<junit-version>4.13.2</junit-version>
<junit-version>5.8.2</junit-version>
<mockito-core-version>3.12.4</mockito-core-version>
<javax.ws.rs-api-version>2.1.1</javax.ws.rs-api-version>
<jsr311-api-version>1.1.1</jsr311-api-version>

View File

@@ -15,8 +15,8 @@ package org.openapitools.client.api;
import org.openapitools.client.ApiException;
import org.openapitools.client.model.SomeObj;
import org.junit.Test;
import org.junit.Ignore;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.HashMap;
@@ -27,7 +27,7 @@ import java.io.InputStream;
/**
* API tests for PingApi
*/
@Ignore
@Disabled
public class PingApiTest {
private final PingApi api = new PingApi();

View File

@@ -21,9 +21,8 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -318,8 +318,8 @@
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
@@ -341,7 +341,7 @@
<commons-lang3-version>3.12.0</commons-lang3-version>
<jackson-databind-nullable-version>0.2.2</jackson-databind-nullable-version>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<junit-version>4.13.2</junit-version>
<junit-version>5.8.2</junit-version>
<mockito-core-version>3.12.4</mockito-core-version>
<javax.ws.rs-api-version>2.1.1</javax.ws.rs-api-version>
<jsr311-api-version>1.1.1</jsr311-api-version>

View File

@@ -10,10 +10,8 @@ import java.text.SimpleDateFormat;
import java.util.*;
import java.util.TimeZone;
import org.junit.*;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import org.junit.jupiter.api.*;
import static org.junit.jupiter.api.Assertions.*;
public class ApiClientTest {
ApiClient apiClient;
@@ -338,7 +336,7 @@ public class ApiClientTest {
public void testNewHttpClient() {
OkHttpClient oldClient = apiClient.getHttpClient();
apiClient.setHttpClient(oldClient.newBuilder().build());
assertThat(apiClient.getHttpClient(), is(not(oldClient)));
assertNotSame(apiClient.getHttpClient(), oldClient);
}
/**

View File

@@ -1,8 +1,7 @@
package org.openapitools.client;
import org.junit.*;
import static org.junit.Assert.*;
import org.junit.jupiter.api.*;
import static org.junit.jupiter.api.Assertions.*;
public class ConfigurationTest {
@Test

View File

@@ -16,14 +16,11 @@ import java.util.Locale;
import java.util.TimeZone;
import okio.ByteString;
import org.junit.*;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import org.threeten.bp.ZoneId;
import org.threeten.bp.ZoneOffset;
import org.threeten.bp.format.DateTimeFormatter;
import static org.junit.Assert.*;
import org.junit.jupiter.api.*;
import static org.junit.jupiter.api.Assertions.*;
public class JSONTest {
private ApiClient apiClient = null;

View File

@@ -1,8 +1,7 @@
package org.openapitools.client;
import org.junit.*;
import static org.junit.Assert.*;
import org.junit.jupiter.api.*;
import static org.junit.jupiter.api.Assertions.*;
public class StringUtilTest {
@Test

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -15,8 +15,8 @@ package org.openapitools.client.api;
import org.openapitools.client.ApiException;
import org.openapitools.client.model.Client;
import org.junit.Test;
import org.junit.Ignore;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.HashMap;
@@ -26,25 +26,22 @@ import java.util.Map;
/**
* API tests for AnotherFakeApi
*/
@Ignore
@Disabled
public class AnotherFakeApiTest {
private final AnotherFakeApi api = new AnotherFakeApi();
/**
* To test special tags
*
* To test special tags and operation ID starting with number
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void call123testSpecialTagsTest() throws ApiException {
Client body = null;
Client response = api.call123testSpecialTags(body);
// TODO: test validations
}

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -23,8 +23,8 @@ import java.time.OffsetDateTime;
import org.openapitools.client.model.OuterComposite;
import org.openapitools.client.model.User;
import org.openapitools.client.model.XmlItem;
import org.junit.Test;
import org.junit.Ignore;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.HashMap;
@@ -34,122 +34,93 @@ import java.util.Map;
/**
* API tests for FakeApi
*/
@Ignore
@Disabled
public class FakeApiTest {
private final FakeApi api = new FakeApi();
/**
* creates an XmlItem
*
* this route creates an XmlItem
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void createXmlItemTest() throws ApiException {
XmlItem xmlItem = null;
api.createXmlItem(xmlItem);
// TODO: test validations
}
/**
*
*
* Test serialization of outer boolean types
*
* @throws ApiException
* if the Api call fails
* @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
* @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
* @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
* @throws ApiException if the Api call fails
*/
@Test
public void fakeOuterStringSerializeTest() throws ApiException {
String body = null;
String response = api.fakeOuterStringSerialize(body);
// TODO: test validations
}
/**
*
*
* For this test, the body for this request much reference a schema named &#x60;File&#x60;.
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void testBodyWithFileSchemaTest() throws ApiException {
FileSchemaTestClass body = null;
api.testBodyWithFileSchema(body);
// TODO: test validations
}
/**
*
*
*
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void testBodyWithQueryParamsTest() throws ApiException {
String query = null;
User body = null;
api.testBodyWithQueryParams(query, body);
// TODO: test validations
}
@@ -158,14 +129,12 @@ public class FakeApiTest {
*
* To test \&quot;client\&quot; model
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void testClientModelTest() throws ApiException {
Client body = null;
Client response = api.testClientModel(body);
// TODO: test validations
}
@@ -174,8 +143,7 @@ public class FakeApiTest {
*
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void testEndpointParametersTest() throws ApiException {
@@ -194,7 +162,6 @@ public class FakeApiTest {
String password = null;
String paramCallback = null;
api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
// TODO: test validations
}
@@ -203,8 +170,7 @@ public class FakeApiTest {
*
* To test enum parameters
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void testEnumParametersTest() throws ApiException {
@@ -217,7 +183,6 @@ public class FakeApiTest {
List<String> enumFormStringArray = null;
String enumFormString = null;
api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
// TODO: test validations
}
@@ -226,8 +191,7 @@ public class FakeApiTest {
*
* Fake endpoint to test group parameters (optional)
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void testGroupParametersTest() throws ApiException {
@@ -242,40 +206,47 @@ public class FakeApiTest {
.booleanGroup(booleanGroup)
.int64Group(int64Group)
.execute();
// TODO: test validations
}
/**
* test inline additionalProperties
*
*
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void testInlineAdditionalPropertiesTest() throws ApiException {
Map<String, String> param = null;
api.testInlineAdditionalProperties(param);
// TODO: test validations
}
/**
* test json serialization of form data
*
*
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void testJsonFormDataTest() throws ApiException {
String param = null;
String param2 = null;
api.testJsonFormData(param, param2);
// TODO: test validations
}
/**
* To test the collection format in query parameters
*
* @throws ApiException if the Api call fails
*/
@Test
public void testQueryParameterCollectionFormatTest() throws ApiException {
List<String> pipe = null;
List<String> ioutil = null;
List<String> http = null;
List<String> url = null;
List<String> context = null;
api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context);
// TODO: test validations
}

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -15,8 +15,8 @@ package org.openapitools.client.api;
import org.openapitools.client.ApiException;
import org.openapitools.client.model.Client;
import org.junit.Test;
import org.junit.Ignore;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.HashMap;
@@ -26,25 +26,22 @@ import java.util.Map;
/**
* API tests for FakeClassnameTags123Api
*/
@Ignore
@Disabled
public class FakeClassnameTags123ApiTest {
private final FakeClassnameTags123Api api = new FakeClassnameTags123Api();
/**
* To test class name in snake case
*
* To test class name in snake case
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void testClassnameTest() throws ApiException {
Client body = null;
Client response = api.testClassname(body);
// TODO: test validations
}

View File

@@ -37,9 +37,8 @@ import java.io.FileWriter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.junit.*;
import static org.junit.Assert.*;
import org.junit.jupiter.api.*;
import static org.junit.jupiter.api.Assertions.*;
/**
* API tests for PetApi
@@ -312,14 +311,14 @@ public class PetApiTest {
}
@Test
@Ignore
@Disabled
public void testFindPetsByTags() throws Exception {
Pet pet = createPet();
pet.setName("monster");
pet.setStatus(Pet.StatusEnum.AVAILABLE);
List<Tag> tags = new ArrayList<Tag>();
Tag tag1 = new Tag();
List<org.openapitools.client.model.Tag> tags = new ArrayList<org.openapitools.client.model.Tag>();
org.openapitools.client.model.Tag tag1 = new org.openapitools.client.model.Tag();
tag1.setName("friendly");
tags.add(tag1);
pet.setTags(tags);

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -15,8 +15,8 @@ package org.openapitools.client.api;
import org.openapitools.client.ApiException;
import org.openapitools.client.model.Order;
import org.junit.Test;
import org.junit.Ignore;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.HashMap;
@@ -26,25 +26,22 @@ import java.util.Map;
/**
* API tests for StoreApi
*/
@Ignore
@Disabled
public class StoreApiTest {
private final StoreApi api = new StoreApi();
/**
* 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
* @throws ApiException if the Api call fails
*/
@Test
public void deleteOrderTest() throws ApiException {
String orderId = null;
api.deleteOrder(orderId);
// TODO: test validations
}
@@ -53,13 +50,11 @@ public class StoreApiTest {
*
* Returns a map of status codes to quantities
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void getInventoryTest() throws ApiException {
Map<String, Integer> response = api.getInventory();
// TODO: test validations
}
@@ -68,30 +63,24 @@ public class StoreApiTest {
*
* 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
* @throws ApiException if the Api call fails
*/
@Test
public void getOrderByIdTest() throws ApiException {
Long orderId = null;
Order response = api.getOrderById(orderId);
// TODO: test validations
}
/**
* Place an order for a pet
*
*
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void placeOrderTest() throws ApiException {
Order body = null;
Order response = api.placeOrder(body);
// TODO: test validations
}

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -14,9 +14,10 @@
package org.openapitools.client.api;
import org.openapitools.client.ApiException;
import java.time.OffsetDateTime;
import org.openapitools.client.model.User;
import org.junit.Test;
import org.junit.Ignore;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.HashMap;
@@ -26,57 +27,46 @@ import java.util.Map;
/**
* API tests for UserApi
*/
@Ignore
@Disabled
public class UserApiTest {
private final UserApi api = new UserApi();
/**
* Create user
*
* This can only be done by the logged in user.
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void createUserTest() throws ApiException {
User body = null;
api.createUser(body);
// TODO: test validations
}
/**
* Creates list of users with given input array
*
*
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void createUsersWithArrayInputTest() throws ApiException {
List<User> body = null;
api.createUsersWithArrayInput(body);
// TODO: test validations
}
/**
* Creates list of users with given input array
*
*
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void createUsersWithListInputTest() throws ApiException {
List<User> body = null;
api.createUsersWithListInput(body);
// TODO: test validations
}
@@ -85,62 +75,48 @@ public class UserApiTest {
*
* This can only be done by the logged in user.
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void deleteUserTest() throws ApiException {
String username = null;
api.deleteUser(username);
// TODO: test validations
}
/**
* Get user by user name
*
*
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void getUserByNameTest() throws ApiException {
String username = null;
User response = api.getUserByName(username);
// TODO: test validations
}
/**
* Logs user into the system
*
*
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void loginUserTest() throws ApiException {
String username = null;
String password = null;
String response = api.loginUser(username, password);
// TODO: test validations
}
/**
* Logs out current logged in user session
*
*
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void logoutUserTest() throws ApiException {
api.logoutUser();
// TODO: test validations
}
@@ -149,15 +125,13 @@ public class UserApiTest {
*
* This can only be done by the logged in user.
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void updateUserTest() throws ApiException {
String username = null;
User body = null;
api.updateUser(username, body);
// TODO: test validations
}

View File

@@ -6,9 +6,9 @@ import java.util.Map;
import java.util.List;
import org.openapitools.client.Pair;
import org.junit.*;
import org.junit.jupiter.api.*;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;
public class ApiKeyAuthTest {
@Test

View File

@@ -6,14 +6,14 @@ import java.util.Map;
import java.util.List;
import org.openapitools.client.Pair;
import org.junit.*;
import static org.junit.Assert.*;
import org.junit.jupiter.api.*;
import static org.junit.jupiter.api.Assertions.*;
public class HttpBasicAuthTest {
HttpBasicAuth auth = null;
@Before
@BeforeEach
public void setup() {
auth = new HttpBasicAuth();
}

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -23,9 +23,8 @@ import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -24,9 +24,8 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -23,9 +23,8 @@ import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,12 +21,12 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
@@ -44,19 +44,91 @@ public class AdditionalPropertiesClassTest {
}
/**
* Test the property 'mapProperty'
* Test the property 'mapString'
*/
@Test
public void mapPropertyTest() {
// TODO: test mapProperty
public void mapStringTest() {
// TODO: test mapString
}
/**
* Test the property 'mapOfMapProperty'
* Test the property 'mapNumber'
*/
@Test
public void mapOfMapPropertyTest() {
// TODO: test mapOfMapProperty
public void mapNumberTest() {
// TODO: test mapNumber
}
/**
* Test the property 'mapInteger'
*/
@Test
public void mapIntegerTest() {
// TODO: test mapInteger
}
/**
* Test the property 'mapBoolean'
*/
@Test
public void mapBooleanTest() {
// TODO: test mapBoolean
}
/**
* Test the property 'mapArrayInteger'
*/
@Test
public void mapArrayIntegerTest() {
// TODO: test mapArrayInteger
}
/**
* Test the property 'mapArrayAnytype'
*/
@Test
public void mapArrayAnytypeTest() {
// TODO: test mapArrayAnytype
}
/**
* Test the property 'mapMapString'
*/
@Test
public void mapMapStringTest() {
// TODO: test mapMapString
}
/**
* Test the property 'mapMapAnytype'
*/
@Test
public void mapMapAnytypeTest() {
// TODO: test mapMapAnytype
}
/**
* Test the property 'anytype1'
*/
@Test
public void anytype1Test() {
// TODO: test anytype1
}
/**
* Test the property 'anytype2'
*/
@Test
public void anytype2Test() {
// TODO: test anytype2
}
/**
* Test the property 'anytype3'
*/
@Test
public void anytype3Test() {
// TODO: test anytype3
}
}

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -23,9 +23,8 @@ import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -24,9 +24,8 @@ import java.io.IOException;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -23,9 +23,8 @@ import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -23,9 +23,8 @@ import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,9 +21,11 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.openapitools.client.model.BigCat;
import org.openapitools.client.model.Cat;
import org.openapitools.client.model.Dog;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -25,9 +25,10 @@ import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* Model tests for ArrayOfArrayOfNumberOnly

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -24,9 +24,8 @@ import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -24,9 +24,8 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.client.model.ReadOnlyFirst;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -21,9 +21,8 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -23,9 +23,8 @@ import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.openapitools.client.model.BigCatAllOf;
import org.openapitools.client.model.Cat;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,9 +21,8 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,9 +21,8 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -22,9 +22,10 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.openapitools.client.model.Animal;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.openapitools.client.model.BigCat;
import org.openapitools.client.model.CatAllOf;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,9 +21,8 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,9 +21,8 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,9 +21,8 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,9 +21,8 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -22,9 +22,9 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.openapitools.client.model.Animal;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.openapitools.client.model.DogAllOf;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -23,9 +23,8 @@ import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -14,9 +14,8 @@
package org.openapitools.client.model;
import com.google.gson.annotations.SerializedName;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -22,9 +22,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.openapitools.client.model.OuterEnum;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -1,56 +0,0 @@
package org.openapitools.client.model;
import org.junit.Test;
import com.google.gson.Gson;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class EnumValueTest {
@Test
public void testEnumClass() {
assertEquals(EnumClass._ABC.toString(), "_abc");
assertEquals(EnumClass._EFG.toString(), "-efg");
assertEquals(EnumClass._XYZ_.toString(), "(xyz)");
}
@Test
public void testEnumTest() {
// test enum value
EnumTest enumTest = new EnumTest();
enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER);
enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1);
enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1);
assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER");
assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER");
assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower");
assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower");
assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1");
assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1);
assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1");
assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1);
assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1");
assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1);
assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2");
assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2);
// test serialization
Gson gson = new Gson();
String json = gson.toJson(enumTest);
assertEquals(json, "{\"enum_string\":\"lower\",\"enum_integer\":1,\"enum_number\":1.1}");
// test deserialization
EnumTest fromString = gson.fromJson(json, EnumTest.class);
assertEquals(fromString.getEnumString().toString(), "lower");
assertEquals(fromString.getEnumString().getValue(), "lower");
assertEquals(fromString.getEnumInteger().toString(), "1");
assertTrue(fromString.getEnumInteger().getValue() == 1);
assertEquals(fromString.getEnumNumber().toString(), "1.1");
assertTrue(fromString.getEnumNumber().getValue() == 1.1);
}
}

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -23,9 +23,9 @@ import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.openapitools.client.model.ModelFile;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
@@ -43,11 +43,11 @@ public class FileSchemaTestClassTest {
}
/**
* Test the property 'file'
* Test the property '_file'
*/
@Test
public void fileTest() {
// TODO: test file
public void _fileTest() {
// TODO: test _file
}
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -23,12 +23,11 @@ import io.swagger.annotations.ApiModelProperty;
import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.UUID;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import java.util.UUID;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
@@ -149,4 +148,12 @@ public class FormatTestTest {
// TODO: test password
}
/**
* Test the property 'bigDecimal'
*/
@Test
public void bigDecimalTest() {
// TODO: test bigDecimal
}
}

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,9 +21,8 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -24,9 +24,8 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,15 +21,14 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.openapitools.client.model.Animal;
import java.time.OffsetDateTime;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,9 +21,8 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,9 +21,8 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -21,9 +21,8 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -21,9 +21,8 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,9 +21,8 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,9 +21,8 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -22,9 +22,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -22,9 +22,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.time.OffsetDateTime;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -22,9 +22,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -14,9 +14,8 @@
package org.openapitools.client.model;
import com.google.gson.annotations.SerializedName;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -22,12 +22,13 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import org.openapitools.client.model.Category;
import org.openapitools.client.model.Tag;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
@@ -41,15 +42,7 @@ public class PetTest {
*/
@Test
public void testPet() {
// test Pet
model.setId(1029L);
model.setName("Dog");
Pet model2 = new Pet();
model2.setId(1029L);
model2.setName("Dog");
Assert.assertTrue(model.equals(model2));
// TODO: test Pet
}
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,9 +21,8 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,9 +21,8 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,9 +21,8 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -24,9 +24,8 @@ import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -24,9 +24,8 @@ import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
@@ -59,6 +58,14 @@ public class TypeHolderExampleTest {
// TODO: test numberItem
}
/**
* Test the property 'floatItem'
*/
@Test
public void floatItemTest() {
// TODO: test floatItem
}
/**
* Test the property 'integerItem'
*/

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,9 +21,8 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -2,7 +2,7 @@
* OpenAPI 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
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -24,9 +24,8 @@ import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -320,8 +320,8 @@
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
@@ -343,7 +343,7 @@
<commons-lang3-version>3.12.0</commons-lang3-version>
<jackson-databind-nullable-version>0.2.2</jackson-databind-nullable-version>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<junit-version>4.13.2</junit-version>
<junit-version>5.8.2</junit-version>
<mockito-core-version>3.12.4</mockito-core-version>
<javax.ws.rs-api-version>2.1.1</javax.ws.rs-api-version>
<jsr311-api-version>1.1.1</jsr311-api-version>

View File

@@ -313,8 +313,8 @@
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
@@ -336,7 +336,7 @@
<commons-lang3-version>3.12.0</commons-lang3-version>
<jackson-databind-nullable-version>0.2.2</jackson-databind-nullable-version>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<junit-version>4.13.2</junit-version>
<junit-version>5.8.2</junit-version>
<mockito-core-version>3.12.4</mockito-core-version>
<javax.ws.rs-api-version>2.1.1</javax.ws.rs-api-version>
<jsr311-api-version>1.1.1</jsr311-api-version>

View File

@@ -1,18 +1,18 @@
package org.openapitools.client;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;
import java.util.*;
import okhttp3.OkHttpClient;
import org.junit.*;
import org.junit.jupiter.api.*;
import org.openapitools.client.auth.*;
public class ApiClientTest {
ApiClient apiClient;
JSON json;
@Before
@BeforeEach
public void setup() {
apiClient = new ApiClient();
json = apiClient.getJSON();
@@ -49,16 +49,16 @@ public class ApiClientTest {
String[] accepts = {"application/json", "application/xml"};
assertEquals("application/json", apiClient.selectHeaderAccept(accepts));
accepts = new String[] {"APPLICATION/XML", "APPLICATION/JSON"};
accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"};
assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts));
accepts = new String[] {"application/xml", "application/json; charset=UTF8"};
accepts = new String[]{"application/xml", "application/json; charset=UTF8"};
assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts));
accepts = new String[] {"text/plain", "application/xml"};
accepts = new String[]{"text/plain", "application/xml"};
assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts));
accepts = new String[] {};
accepts = new String[]{};
assertNull(apiClient.selectHeaderAccept(accepts));
}
@@ -67,17 +67,17 @@ public class ApiClientTest {
String[] contentTypes = {"application/json", "application/xml"};
assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes));
contentTypes = new String[] {"APPLICATION/JSON", "APPLICATION/XML"};
contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"};
assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes));
contentTypes = new String[] {"application/xml", "application/json; charset=UTF8"};
contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"};
assertEquals(
"application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes));
contentTypes = new String[] {"text/plain", "application/xml"};
contentTypes = new String[]{"text/plain", "application/xml"};
assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes));
contentTypes = new String[] {};
contentTypes = new String[]{};
assertNull(apiClient.selectHeaderContentType(contentTypes));
}
@@ -334,12 +334,17 @@ public class ApiClientTest {
public void testNewHttpClient() {
OkHttpClient oldClient = apiClient.getHttpClient();
apiClient.setHttpClient(oldClient.newBuilder().build());
assertThat(apiClient.getHttpClient(), is(not(oldClient)));
assertNotSame(apiClient.getHttpClient(), oldClient);
}
/** Tests the invariant that the HttpClient for the ApiClient must never be null */
@Test(expected = NullPointerException.class)
/**
* Tests the invariant that the HttpClient for the ApiClient must never be null
*/
@Test
public void testNullHttpClient() {
NullPointerException thrown = Assertions.assertThrows(NullPointerException.class, () -> {
apiClient.setHttpClient(null);
});
Assertions.assertEquals("HttpClient must not be null!", thrown.getMessage());
}
}

View File

@@ -1,8 +1,8 @@
package org.openapitools.client;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.*;
import org.junit.jupiter.api.*;
public class ConfigurationTest {
@Test

View File

@@ -1,10 +1,11 @@
package org.openapitools.client;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.lang.reflect.Type;
import java.nio.charset.StandardCharsets;
@@ -20,8 +21,9 @@ import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.TimeZone;
import okio.ByteString;
import org.junit.*;
import org.junit.jupiter.api.*;
import org.openapitools.client.model.Order;
import org.openapitools.client.model.*;
@@ -31,7 +33,7 @@ public class JSONTest {
private JSON json = null;
private Order order = null;
@Before
@BeforeEach
public void setup() {
apiClient = new ApiClient();
json = apiClient.getJSON();
@@ -145,7 +147,8 @@ public class JSONTest {
order.setShipDate(OffsetDateTime.from(datetimeFormat.parse(dateStr)));
String str = json.serialize(order);
Type type = new TypeToken<Order>() {}.getType();
Type type = new TypeToken<Order>() {
}.getType();
Order o = json.deserialize(str, type);
assertEquals(dateStr, datetimeFormat.format(o.getShipDate()));
}
@@ -158,7 +161,8 @@ public class JSONTest {
order.setShipDate(OffsetDateTime.from(datetimeFormat.parse(dateStr)));
String str = json.serialize(order);
Type type = new TypeToken<Order>() {}.getType();
Type type = new TypeToken<Order>() {
}.getType();
Order o = json.deserialize(str, type);
assertEquals(dateStr, datetimeFormat.format(o.getShipDate()));
}
@@ -191,7 +195,8 @@ public class JSONTest {
final ByteString expectedByteString = ByteString.of(expectedBytes);
final String serializedBytes = expectedByteString.base64();
final String serializedBytesWithQuotes = "\"" + serializedBytes + "\"";
Type type = new TypeToken<byte[]>() {}.getType();
Type type = new TypeToken<byte[]>() {
}.getType();
// Act
byte[] actualDeserializedBytes = json.deserialize(serializedBytesWithQuotes, type);
@@ -201,8 +206,9 @@ public class JSONTest {
expectedBytesAsString, new String(actualDeserializedBytes, StandardCharsets.UTF_8));
}
@Test(expected = IllegalArgumentException.class)
@Test
public void testRequiredFieldException() {
IllegalArgumentException thrown = Assertions.assertThrows(IllegalArgumentException.class, () -> {
// test json string missing required field(s) to ensure exception is thrown
Gson gson = json.getGson();
//Gson gson = new GsonBuilder()
@@ -212,17 +218,24 @@ public class JSONTest {
//String json = "{\"id2\": 5847, \"name\":\"tag test 1\"}";
//String json = "{\"id\": 5847}";
Pet p = gson.fromJson(json, Pet.class);
});
Assertions.assertEquals("The required field `photoUrls` is not found in the JSON string: {\"id\":5847,\"name\":\"tag test 1\"}", thrown.getMessage());
}
@Test(expected = IllegalArgumentException.class)
@Test
public void testAdditionalFieldException() {
IllegalArgumentException thrown = Assertions.assertThrows(IllegalArgumentException.class, () -> {
// test json string with additional field(s) to ensure exception is thrown
Gson gson = json.getGson();
//Gson gson = new GsonBuilder()
// .registerTypeAdapter(Tag.class, new Tag.CustomDeserializer())
// .create();
String json = "{\"id\": 5847, \"name\":\"tag test 1\", \"new-field\": true}";
Tag t = gson.fromJson(json, Tag.class);
org.openapitools.client.model.Tag t = gson.fromJson(json, org.openapitools.client.model.Tag.class);
});
Assertions.assertEquals("The field `new-field` in the JSON string is not defined in the `Tag` properties. JSON: {\"id\":5847,\"name\":\"tag test 1\",\"new-field\":true}", thrown.getMessage());
}
@Test
@@ -234,13 +247,13 @@ public class JSONTest {
// .create();
// id and name
String json = "{\"id\": 5847, \"name\":\"tag test 1\"}";
Tag t = gson.fromJson(json, Tag.class);
org.openapitools.client.model.Tag t = gson.fromJson(json, org.openapitools.client.model.Tag.class);
assertEquals(t.getName(), "tag test 1");
assertEquals(t.getId(), Long.valueOf(5847L));
// name only
String json2 = "{\"name\":\"tag test 1\"}";
Tag t2 = gson.fromJson(json2, Tag.class);
org.openapitools.client.model.Tag t2 = gson.fromJson(json2, org.openapitools.client.model.Tag.class);
assertEquals(t2.getName(), "tag test 1");
assertEquals(t2.getId(), null);
@@ -259,7 +272,7 @@ public class JSONTest {
// test Tag
String json5 = "{\"unknown_field\": 543, \"id\":\"tag 123\"}";
Exception exception5 = assertThrows(java.lang.IllegalArgumentException.class, () -> {
Tag t5 = gson.fromJson(json5, Tag.class);
org.openapitools.client.model.Tag t5 = gson.fromJson(json5, org.openapitools.client.model.Tag.class);
});
assertTrue(exception5.getMessage().contains("The field `unknown_field` in the JSON string is not defined in the `Tag` properties. JSON: {\"unknown_field\":543,\"id\":\"tag 123\"}"));
@@ -283,11 +296,11 @@ public class JSONTest {
PetWithRequiredTags t8 = gson.fromJson(json8, PetWithRequiredTags.class);
});
assertTrue(exception8.getMessage().contains("The required field `tags` is not found in the JSON string: {\"id\":5847,\"name\":\"pet test 1\",\"photoUrls\":[\"https://a.com\",\"https://b.com\"]}"));
}
/** Model tests for Pet */
/**
* Model tests for Pet
*/
@Test
public void testPet() {
// test Pet
@@ -299,7 +312,7 @@ public class JSONTest {
model2.setId(1029L);
model2.setName("Dog");
Assert.assertTrue(model.equals(model2));
assertTrue(model.equals(model2));
}
// Obtained 22JAN2018 from stackoverflow answer by PuguaSoft

View File

@@ -1,8 +1,8 @@
package org.openapitools.client;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.*;
import org.junit.jupiter.api.*;
public class StringUtilTest {
@Test

View File

@@ -13,13 +13,13 @@
package org.openapitools.client.api;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.openapitools.client.ApiException;
import org.openapitools.client.model.Client;
/** API tests for AnotherFakeApi */
@Ignore
@Disabled
public class AnotherFakeApiTest {
private final AnotherFakeApi api = new AnotherFakeApi();

View File

@@ -15,8 +15,8 @@ package org.openapitools.client.api;
import org.openapitools.client.ApiException;
import org.openapitools.client.model.InlineResponseDefault;
import org.junit.Test;
import org.junit.Ignore;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Disabled;
import java.util.ArrayList;
import java.util.HashMap;
@@ -26,7 +26,7 @@ import java.util.Map;
/**
* API tests for DefaultApi
*/
@Ignore
@Disabled
public class DefaultApiTest {
private final DefaultApi api = new DefaultApi();

View File

@@ -24,8 +24,8 @@ import java.time.OffsetDateTime;
import org.openapitools.client.model.OuterComposite;
import org.openapitools.client.model.OuterEnum;
import org.openapitools.client.model.User;
import org.junit.Test;
import org.junit.Ignore;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Disabled;
import java.util.ArrayList;
import java.util.HashMap;
@@ -35,7 +35,7 @@ import java.util.Map;
/**
* API tests for FakeApi
*/
@Ignore
@Disabled
public class FakeApiTest {
private final FakeApi api = new FakeApi();

View File

@@ -13,13 +13,13 @@
package org.openapitools.client.api;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.openapitools.client.ApiException;
import org.openapitools.client.model.Client;
/** API tests for FakeClassnameTags123Api */
@Ignore
@Disabled
public class FakeClassnameTags123ApiTest {
private final FakeClassnameTags123Api api = new FakeClassnameTags123Api();

View File

@@ -12,7 +12,7 @@
package org.openapitools.client.api;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;
import java.io.BufferedWriter;
import java.io.File;
@@ -29,7 +29,8 @@ import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
import org.junit.*;
import org.junit.jupiter.api.*;
import org.openapitools.client.*;
import org.openapitools.client.ApiException;
import org.openapitools.client.auth.*;
@@ -38,7 +39,9 @@ import org.openapitools.client.model.Pet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** API tests for PetApi */
/**
* API tests for PetApi
*/
public class PetApiTest {
private PetApi api = new PetApi();
@@ -47,7 +50,7 @@ public class PetApiTest {
// to 127.0.0.1
private static String basePath = "http://petstore.swagger.io:80/v2";
@Before
@BeforeEach
public void setup() {
// setup authentication
ApiKeyAuth apiKeyAuth = (ApiKeyAuth) api.getApiClient().getAuthentication("api_key");
@@ -323,14 +326,14 @@ public class PetApiTest {
}
@Test
@Ignore
@Disabled
public void testFindPetsByTags() throws Exception {
Pet pet = createPet();
pet.setName("monster");
pet.setStatus(Pet.StatusEnum.AVAILABLE);
List<Tag> tags = new ArrayList<Tag>();
Tag tag1 = new Tag();
List<org.openapitools.client.model.Tag> tags = new ArrayList<org.openapitools.client.model.Tag>();
org.openapitools.client.model.Tag tag1 = new org.openapitools.client.model.Tag();
tag1.setName("friendly");
tags.add(tag1);
pet.setTags(tags);
@@ -368,7 +371,7 @@ public class PetApiTest {
}
@Test
@Ignore
@Disabled
public void testDeletePet() throws Exception {
Pet pet = createPet();
api.addPet(pet);

View File

@@ -14,13 +14,13 @@ package org.openapitools.client.api;
import java.util.Map;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.openapitools.client.ApiException;
import org.openapitools.client.model.Order;
/** API tests for StoreApi */
@Ignore
@Disabled
public class StoreApiTest {
private final StoreApi api = new StoreApi();

View File

@@ -14,13 +14,13 @@ package org.openapitools.client.api;
import java.util.List;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.openapitools.client.ApiException;
import org.openapitools.client.model.User;
/** API tests for UserApi */
@Ignore
@Disabled
public class UserApiTest {
private final UserApi api = new UserApi();

View File

@@ -1,12 +1,12 @@
package org.openapitools.client.auth;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.*;
import org.junit.jupiter.api.*;
import org.openapitools.client.ApiException;
import org.openapitools.client.Pair;

View File

@@ -1,19 +1,19 @@
package org.openapitools.client.auth;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.*;
import org.junit.jupiter.api.*;
import org.openapitools.client.ApiException;
import org.openapitools.client.Pair;
public class HttpBasicAuthTest {
HttpBasicAuth auth = null;
@Before
@BeforeEach
public void setup() {
auth = new HttpBasicAuth();
}

View File

@@ -1,6 +1,6 @@
package org.openapitools.client.auth;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -12,6 +12,7 @@ import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import okhttp3.*;
import okhttp3.Interceptor.Chain;
import okhttp3.Response.Builder;
@@ -21,8 +22,8 @@ import org.apache.oltu.oauth2.client.request.OAuthClientRequest;
import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse;
import org.apache.oltu.oauth2.common.exception.OAuthProblemException;
import org.apache.oltu.oauth2.common.exception.OAuthSystemException;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.*;
import org.junit.jupiter.api.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
@@ -30,7 +31,7 @@ public class RetryingOAuthTest {
private RetryingOAuth oauth;
@Before
@BeforeEach
public void setUp() throws Exception {
oauth =
new RetryingOAuth(

View File

@@ -25,9 +25,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.jackson.nullable.JsonNullable;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -23,9 +23,9 @@ import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.openapitools.client.model.Cat;
import org.openapitools.client.model.Dog;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -21,9 +21,9 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -21,9 +21,9 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -24,9 +24,9 @@ import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -24,9 +24,9 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.client.model.ReadOnlyFirst;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -22,9 +22,9 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -22,9 +22,9 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -21,9 +21,9 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -21,9 +21,9 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -21,9 +21,9 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -23,9 +23,9 @@ import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.openapitools.client.model.Animal;
import org.openapitools.client.model.CatAllOf;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -21,9 +21,9 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -21,9 +21,9 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -21,9 +21,9 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

View File

@@ -23,9 +23,9 @@ import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.openapitools.client.model.QuadrilateralInterface;
import org.openapitools.client.model.ShapeInterface;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**

Some files were not shown because too many files have changed in this diff Show More