-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[JAVA][FEIGN] Implement unit tests for java-feign client #8484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
wing328
merged 14 commits into
OpenAPITools:master
from
hugo-ma-alves:feature/implement-unittest-java-feign
Jan 23, 2021
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c537aa5
Implement unit tests for feign client
hugo-ma-alves 490b605
Default feign client does not support PATCH verb
hugo-ma-alves 0cba8b1
Remove test for GET endpoint with request body
hugo-ma-alves aaffdc9
Configure junit in gradle build
hugo-ma-alves ac4a38b
Configure logback for unit tests
hugo-ma-alves def429a
Add missing dependencies to sbt
hugo-ma-alves b486b5d
Fix gradle dependency
hugo-ma-alves 230edaf
Add logback to gradle unit test
hugo-ma-alves c0695b5
Regenerate samples
hugo-ma-alves 0d09024
Make junit test classes package private
hugo-ma-alves 712ee1a
Make junit test classes package private
hugo-ma-alves 9c2a220
Update samples
hugo-ma-alves c2df25b
Organize imports
hugo-ma-alves 19db943
Organize imports
hugo-ma-alves File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
48 changes: 48 additions & 0 deletions
48
modules/openapi-generator/src/main/resources/Java/libraries/feign/model_test.mustache
This file contains hidden or 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,48 @@ | ||
| {{>licenseInfo}} | ||
|
|
||
| package {{package}}; | ||
|
|
||
| {{#imports}}import {{import}}; | ||
| {{/imports}} | ||
| 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}} | ||
| */ | ||
| class {{classname}}Test { | ||
| {{#models}} | ||
| {{#model}} | ||
| {{^vendorExtensions.x-is-one-of-interface}} | ||
| {{^isEnum}} | ||
| private final {{classname}} model = new {{classname}}(); | ||
|
|
||
| {{/isEnum}} | ||
| /** | ||
| * Model tests for {{classname}} | ||
| */ | ||
| @Test | ||
| void test{{classname}}() { | ||
| // TODO: test {{classname}} | ||
| } | ||
|
|
||
| {{#allVars}} | ||
| /** | ||
| * Test the property '{{name}}' | ||
| */ | ||
| @Test | ||
| void {{name}}Test() { | ||
| // TODO: test {{name}} | ||
| } | ||
|
|
||
| {{/allVars}} | ||
| {{/vendorExtensions.x-is-one-of-interface}} | ||
| {{/model}} | ||
| {{/models}} | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.