Skip to content

Commit 7e5bb0b

Browse files
committed
update faulty sample tests
1 parent 6a42b9b commit 7e5bb0b

File tree

73 files changed

+482
-1198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+482
-1198
lines changed

samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515

1616
import org.openapitools.client.ApiException;
1717
import org.openapitools.client.model.Client;
18-
import org.junit.jupiter.api.Test;
19-
import org.junit.jupiter.api.Disabled;
2018
import org.junit.jupiter.api.Assertions;
19+
import org.junit.jupiter.api.Disabled;
20+
import org.junit.jupiter.api.Test;
2121

22+
import java.time.LocalDate;
23+
import java.time.OffsetDateTime;
2224
import java.util.ArrayList;
2325
import java.util.HashMap;
2426
import java.util.List;
@@ -42,8 +44,8 @@ public class AnotherFakeApiTest {
4244
*/
4345
@Test
4446
public void call123testSpecialTagsTest() throws ApiException {
45-
Client body = null;
46-
Client response = api.call123testSpecialTags(body);
47+
Client client = null;
48+
Client response = api.call123testSpecialTags(client);
4749

4850
// TODO: test validations
4951
}

samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/DefaultApiTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
import org.openapitools.client.ApiException;
1717
import org.openapitools.client.model.FooGetDefaultResponse;
18-
import org.junit.jupiter.api.Test;
19-
import org.junit.jupiter.api.Disabled;
2018
import org.junit.jupiter.api.Assertions;
19+
import org.junit.jupiter.api.Disabled;
20+
import org.junit.jupiter.api.Test;
2121

2222
import java.time.LocalDate;
2323
import java.time.OffsetDateTime;

samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/FakeApiTest.java

Lines changed: 80 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515

1616
import org.openapitools.client.ApiException;
1717
import java.math.BigDecimal;
18+
import org.openapitools.client.model.ChildWithNullable;
1819
import org.openapitools.client.model.Client;
1920
import org.openapitools.client.model.EnumClass;
21+
import org.openapitools.client.model.FakeBigDecimalMap200Response;
2022
import java.io.File;
2123
import org.openapitools.client.model.FileSchemaTestClass;
2224
import org.openapitools.client.model.HealthCheckResult;
@@ -25,10 +27,11 @@
2527
import org.openapitools.client.model.OuterComposite;
2628
import org.openapitools.client.model.OuterObjectWithEnumProperty;
2729
import org.openapitools.client.model.Pet;
30+
import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest;
2831
import org.openapitools.client.model.User;
29-
import org.junit.jupiter.api.Test;
30-
import org.junit.jupiter.api.Disabled;
3132
import org.junit.jupiter.api.Assertions;
33+
import org.junit.jupiter.api.Disabled;
34+
import org.junit.jupiter.api.Test;
3235

3336
import java.time.LocalDate;
3437
import java.time.OffsetDateTime;
@@ -45,6 +48,18 @@ public class FakeApiTest {
4548

4649
private final FakeApi api = new FakeApi();
4750

51+
/**
52+
* for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
53+
*
54+
* @throws ApiException
55+
* if the Api call fails
56+
*/
57+
@Test
58+
public void fakeBigDecimalMapTest() throws ApiException {
59+
FakeBigDecimalMap200Response response = api.fakeBigDecimalMap();
60+
61+
// TODO: test validations
62+
}
4863
/**
4964
* Health check endpoint
5065
*
@@ -137,6 +152,21 @@ public void fakePropertyEnumIntegerSerializeTest() throws ApiException {
137152

138153
// TODO: test validations
139154
}
155+
/**
156+
* test referenced additionalProperties
157+
*
158+
*
159+
*
160+
* @throws ApiException
161+
* if the Api call fails
162+
*/
163+
@Test
164+
public void testAdditionalPropertiesReferenceTest() throws ApiException {
165+
Map<String, Object> requestBody = null;
166+
api.testAdditionalPropertiesReference(requestBody);
167+
168+
// TODO: test validations
169+
}
140170
/**
141171
* For this test, the body has to be a binary file.
142172
*
@@ -237,7 +267,9 @@ public void testEnumParametersTest() throws ApiException {
237267
List<EnumClass> enumQueryModelArray = null;
238268
List<String> enumFormStringArray = null;
239269
String enumFormString = null;
240-
api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString);
270+
Integer enumFormInteger = null;
271+
BigDecimal enumFormDouble = null;
272+
api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString, enumFormInteger, enumFormDouble);
241273

242274
// TODO: test validations
243275
}
@@ -276,6 +308,21 @@ public void testInlineAdditionalPropertiesTest() throws ApiException {
276308

277309
// TODO: test validations
278310
}
311+
/**
312+
* test inline free-form additionalProperties
313+
*
314+
*
315+
*
316+
* @throws ApiException
317+
* if the Api call fails
318+
*/
319+
@Test
320+
public void testInlineFreeformAdditionalPropertiesTest() throws ApiException {
321+
TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = null;
322+
api.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest);
323+
324+
// TODO: test validations
325+
}
279326
/**
280327
* test json serialization of form data
281328
*
@@ -292,6 +339,21 @@ public void testJsonFormDataTest() throws ApiException {
292339

293340
// TODO: test validations
294341
}
342+
/**
343+
* test nullable parent property
344+
*
345+
*
346+
*
347+
* @throws ApiException
348+
* if the Api call fails
349+
*/
350+
@Test
351+
public void testNullableTest() throws ApiException {
352+
ChildWithNullable childWithNullable = null;
353+
api.testNullable(childWithNullable);
354+
355+
// TODO: test validations
356+
}
295357
/**
296358
* To test the collection format in query parameters
297359
*
@@ -309,6 +371,21 @@ public void testQueryParameterCollectionFormatTest() throws ApiException {
309371
Map<String, String> language = null;
310372
api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language);
311373

374+
// TODO: test validations
375+
}
376+
/**
377+
* test referenced string map
378+
*
379+
*
380+
*
381+
* @throws ApiException
382+
* if the Api call fails
383+
*/
384+
@Test
385+
public void testStringMapReferenceTest() throws ApiException {
386+
Map<String, String> requestBody = null;
387+
api.testStringMapReference(requestBody);
388+
312389
// TODO: test validations
313390
}
314391
}

samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515

1616
import org.openapitools.client.ApiException;
1717
import org.openapitools.client.model.Client;
18-
import org.junit.jupiter.api.Test;
19-
import org.junit.jupiter.api.Disabled;
2018
import org.junit.jupiter.api.Assertions;
19+
import org.junit.jupiter.api.Disabled;
20+
import org.junit.jupiter.api.Test;
2121

22+
import java.time.LocalDate;
23+
import java.time.OffsetDateTime;
2224
import java.util.ArrayList;
2325
import java.util.HashMap;
2426
import java.util.List;
@@ -42,8 +44,8 @@ public class FakeClassnameTags123ApiTest {
4244
*/
4345
@Test
4446
public void testClassnameTest() throws ApiException {
45-
Client body = null;
46-
Client response = api.testClassname(body);
47+
Client client = null;
48+
Client response = api.testClassname(client);
4749

4850
// TODO: test validations
4951
}

samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/PetApiTest.java

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
import org.openapitools.client.model.ModelApiResponse;
1919
import org.openapitools.client.model.Pet;
2020
import java.util.Set;
21-
import org.junit.jupiter.api.Test;
22-
import org.junit.jupiter.api.Disabled;
2321
import org.junit.jupiter.api.Assertions;
22+
import org.junit.jupiter.api.Disabled;
23+
import org.junit.jupiter.api.Test;
2424

25+
import java.time.LocalDate;
26+
import java.time.OffsetDateTime;
2527
import java.util.ArrayList;
2628
import java.util.HashMap;
2729
import java.util.List;
@@ -38,19 +40,23 @@ public class PetApiTest {
3840
/**
3941
* Add a new pet to the store
4042
*
43+
*
44+
*
4145
* @throws ApiException
4246
* if the Api call fails
4347
*/
4448
@Test
4549
public void addPetTest() throws ApiException {
46-
Pet body = null;
47-
api.addPet(body);
50+
Pet pet = null;
51+
api.addPet(pet);
4852

4953
// TODO: test validations
5054
}
5155
/**
5256
* Deletes a pet
5357
*
58+
*
59+
*
5460
* @throws ApiException
5561
* if the Api call fails
5662
*/
@@ -110,19 +116,23 @@ public void getPetByIdTest() throws ApiException {
110116
/**
111117
* Update an existing pet
112118
*
119+
*
120+
*
113121
* @throws ApiException
114122
* if the Api call fails
115123
*/
116124
@Test
117125
public void updatePetTest() throws ApiException {
118-
Pet body = null;
119-
api.updatePet(body);
126+
Pet pet = null;
127+
api.updatePet(pet);
120128

121129
// TODO: test validations
122130
}
123131
/**
124132
* Updates a pet in the store with form data
125133
*
134+
*
135+
*
126136
* @throws ApiException
127137
* if the Api call fails
128138
*/
@@ -138,21 +148,25 @@ public void updatePetWithFormTest() throws ApiException {
138148
/**
139149
* uploads an image
140150
*
151+
*
152+
*
141153
* @throws ApiException
142154
* if the Api call fails
143155
*/
144156
@Test
145157
public void uploadFileTest() throws ApiException {
146158
Long petId = null;
147159
String additionalMetadata = null;
148-
File file = null;
149-
ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file);
160+
File _file = null;
161+
ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file);
150162

151163
// TODO: test validations
152164
}
153165
/**
154166
* uploads an image (required)
155167
*
168+
*
169+
*
156170
* @throws ApiException
157171
* if the Api call fails
158172
*/

samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/StoreApiTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515

1616
import org.openapitools.client.ApiException;
1717
import org.openapitools.client.model.Order;
18-
import org.junit.jupiter.api.Test;
19-
import org.junit.jupiter.api.Disabled;
2018
import org.junit.jupiter.api.Assertions;
19+
import org.junit.jupiter.api.Disabled;
20+
import org.junit.jupiter.api.Test;
2121

22+
import java.time.LocalDate;
23+
import java.time.OffsetDateTime;
2224
import java.util.ArrayList;
2325
import java.util.HashMap;
2426
import java.util.List;
@@ -79,13 +81,15 @@ public void getOrderByIdTest() throws ApiException {
7981
/**
8082
* Place an order for a pet
8183
*
84+
*
85+
*
8286
* @throws ApiException
8387
* if the Api call fails
8488
*/
8589
@Test
8690
public void placeOrderTest() throws ApiException {
87-
Order body = null;
88-
Order response = api.placeOrder(body);
91+
Order order = null;
92+
Order response = api.placeOrder(order);
8993

9094
// TODO: test validations
9195
}

0 commit comments

Comments
 (0)