-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Collision with java keywords Import Statement for BigDecimal/BigInteger not generated for request body
- Loading branch information
Aleksandar Stojsavljevic
committed
Sep 28, 2018
1 parent
5ad8ccc
commit 1368ef1
Showing
35 changed files
with
2,711 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
60 changes: 60 additions & 0 deletions
60
src/test/java/com/phoenixnap/oss/ramlplugin/raml2code/github/Issue152RulesTest.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,60 @@ | ||
package com.phoenixnap.oss.ramlplugin.raml2code.github; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import com.phoenixnap.oss.ramlplugin.raml2code.data.ApiResourceMetadata; | ||
import com.phoenixnap.oss.ramlplugin.raml2code.plugin.Config; | ||
import com.phoenixnap.oss.ramlplugin.raml2code.rules.ConfigurableRule; | ||
import com.phoenixnap.oss.ramlplugin.raml2code.rules.GitHubAbstractRuleTestBase; | ||
import com.phoenixnap.oss.ramlplugin.raml2code.rules.Spring4ControllerDecoratorRule; | ||
import com.phoenixnap.oss.ramlplugin.raml2code.rules.Spring4ControllerInterfaceRule; | ||
import com.phoenixnap.oss.ramlplugin.raml2code.rules.Spring4RestTemplateClientRule; | ||
import com.phoenixnap.oss.ramlplugin.raml2code.rules.TestPojoConfig; | ||
import com.sun.codemodel.JCodeModel; | ||
import com.sun.codemodel.JDefinedClass; | ||
|
||
/** | ||
* @author aleksandars | ||
* @since 2.0.4 | ||
*/ | ||
public class Issue152RulesTest extends GitHubAbstractRuleTestBase { | ||
|
||
private ConfigurableRule<JCodeModel, JDefinedClass, ApiResourceMetadata> rule; | ||
|
||
@Before | ||
public void init() { | ||
super.setGitHubValidatorBase(DEFAULT_GITHUB_VALIDATOR_BASE + "issue-152/"); | ||
} | ||
|
||
@Test | ||
public void collision_java_keywords_decorator() throws Exception { | ||
((TestPojoConfig) Config.getPojoConfig()).setUseBigIntegers(true); | ||
loadRaml("issue-152.raml"); | ||
rule = new Spring4ControllerDecoratorRule(); | ||
rule.apply(getControllerMetadata(), jCodeModel); | ||
verifyGeneratedCode("Issue152-Spring4ControllerDecorator"); | ||
((TestPojoConfig) Config.getPojoConfig()).setUseBigIntegers(false); | ||
} | ||
|
||
@Test | ||
public void collision_java_keywords_interface() throws Exception { | ||
((TestPojoConfig) Config.getPojoConfig()).setUseBigIntegers(true); | ||
loadRaml("issue-152.raml"); | ||
rule = new Spring4ControllerInterfaceRule(); | ||
rule.apply(getControllerMetadata(), jCodeModel); | ||
verifyGeneratedCode("Issue152-Spring4ControllerInterface"); | ||
((TestPojoConfig) Config.getPojoConfig()).setUseBigIntegers(false); | ||
} | ||
|
||
@Test | ||
public void collision_java_keywords_client() throws Exception { | ||
((TestPojoConfig) Config.getPojoConfig()).setUseBigIntegers(true); | ||
loadRaml("issue-152.raml"); | ||
rule = new Spring4RestTemplateClientRule(); | ||
rule.apply(getControllerMetadata(), jCodeModel); | ||
verifyGeneratedCode("Issue152-Spring4RestTemplateClient"); | ||
((TestPojoConfig) Config.getPojoConfig()).setUseBigIntegers(false); | ||
} | ||
|
||
} |
Oops, something went wrong.