-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementing retry logic to restTemplate (#17375)
* Implementing retry logic to restTemplate * Fixing the issue * Adding import * Fix * Fix * minor update, add tests * fix * Adding the maxRetryAttempt, threadWaitTime as additionalProperty * Updating the apiClient * Removing reduntant variable * Generating samples * Fixing format --------- Co-authored-by: Rubini <[email protected]> Co-authored-by: William Cheng <[email protected]>
- Loading branch information
1 parent
809b333
commit a792a79
Showing
11 changed files
with
579 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...s/client/echo_api/java/resttemplate/src/test/java/org/openapitools/client/CustomTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Echo Server API | ||
* Echo Server API | ||
* | ||
* The version of the OpenAPI document: 0.1.0 | ||
* Contact: [email protected] | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
|
||
package org.openapitools.client; | ||
|
||
import org.junit.Assert; | ||
import org.openapitools.client.api.*; | ||
import org.openapitools.client.model.*; | ||
import org.junit.Test; | ||
import org.junit.Ignore; | ||
|
||
import java.io.IOException; | ||
import java.util.*; | ||
|
||
|
||
/** | ||
* API tests | ||
*/ | ||
public class CustomTest { | ||
|
||
private final QueryApi api = new QueryApi(); | ||
private final BodyApi bodyApi = new BodyApi(); | ||
|
||
/** | ||
* Test body parameter(s) | ||
* <p> | ||
* Test body parameter(s) | ||
* | ||
*/ | ||
@Test | ||
public void testEchoBodyPet() { | ||
Pet pet = new Pet().id(12345L).name("Hello World"). | ||
photoUrls(Arrays.asList(new String[]{"http://a.com", "http://b.com"})).category(new Category().id(987L).name("new category")); | ||
|
||
Pet p = bodyApi.testEchoBodyPet(pet); | ||
Assert.assertNotNull(p); | ||
Assert.assertEquals("Hello World", p.getName()); | ||
Assert.assertEquals(Long.valueOf(12345L), p.getId()); | ||
|
||
// response is empty body | ||
Pet p2 = bodyApi.testEchoBodyPet(null); | ||
Assert.assertNull(p2); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.