From 43a6836eb88caf117ac334790cbcfd19c1114a66 Mon Sep 17 00:00:00 2001 From: Tobias Brennecke Date: Tue, 8 Jan 2019 21:48:51 +0100 Subject: [PATCH 1/3] Issue #244 Migration to Spring Boot 2.x.x --- pom.xml | 556 +++++++++--------- .../rules/SpringFeignClientInterfaceRule.java | 2 +- .../SpringFeignClientClassAnnotationRule.java | 2 +- ...ringFeignClientInterfaceDecoratorRule.java | 2 +- .../validations/FeignClient.java.txt | 2 +- .../FeignClientDefaultValues.java.txt | 2 +- .../Issue284FeignClientInterface.java.txt | 2 +- .../Issue254-FeignClientInterface.java.txt | 2 +- .../Issue286-1Spring4FeignClient.java.txt | 2 +- .../Issue286-2Spring4FeignClient.java.txt | 2 +- 10 files changed, 287 insertions(+), 287 deletions(-) diff --git a/pom.xml b/pom.xml index f1ec1a45..9e8fd993 100644 --- a/pom.xml +++ b/pom.xml @@ -1,296 +1,296 @@ - 4.0.0 - - com.phoenixnap.oss - springmvc-raml-plugin - 2.0.5 - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + com.phoenixnap.oss + springmvc-raml-plugin + 2.0.5 + + io.spring.platform platform-bom Brussels-SR6 - - RAML to Spring MVC code generator - Component is Maven plugin that reads RAML documents and creates Spring MVC endpoints - https://github.com/phoenixnap/springmvc-raml-plugin/tree/master/springmvc-raml-parser - maven-plugin - - - - Aleksandar Stojsavljevic - aleksandars@ccbill.com - CCBill - http://www.ccbill.com - - - - - - The Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - - - - - scm:git:git@github.com:phoenixnap/springmvc-raml-plugin.git - scm:git:git@github.com:phoenixnap/springmvc-raml-plugin.git - git@github.com:phoenixnap/springmvc-raml-plugin.git - - - - UTF-8 - 1.8 - 1.8 - true - - 1.6.2 - 3.3.9 + + RAML to Spring MVC code generator + Component is Maven plugin that reads RAML documents and creates Spring MVC endpoints + https://github.com/phoenixnap/springmvc-raml-plugin/tree/master/springmvc-raml-parser + maven-plugin + + + + Aleksandar Stojsavljevic + aleksandars@ccbill.com + CCBill + http://www.ccbill.com + + + + + + The Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + scm:git:git@github.com:phoenixnap/springmvc-raml-plugin.git + scm:git:git@github.com:phoenixnap/springmvc-raml-plugin.git + git@github.com:phoenixnap/springmvc-raml-plugin.git + + + + UTF-8 + 1.8 + 1.8 + true + + 1.6.2 + 3.3.9 0.5.1 - 1.0.28 - 1.1.6.RELEASE + 1.0.28 + 2.0.2.RELEASE 2.6 - - - + + + + + + commons-io + commons-io + + + + commons-collections + commons-collections + + + + org.raml + raml-parser-2 + ${ramlparser2.version} + + + + org.jsonschema2pojo + jsonschema2pojo-core + ${jsonschema2pojo.version} + - - commons-io - commons-io - - - - commons-collections - commons-collections - - - - org.raml - raml-parser-2 - ${ramlparser2.version} - - - - org.jsonschema2pojo - jsonschema2pojo-core - ${jsonschema2pojo.version} - - com.sun.codemodel codemodel ${codemodel.version} - - - org.springframework.cloud - spring-cloud-starter-feign - ${feign.client.version} - true - - - org.springframework.boot - spring-boot-starter-logging - - - - - - javax.servlet - javax.servlet-api - provided - - - - - - org.apache.maven - maven-core - ${maven.core.version} - - - org.apache.maven - maven-plugin-api - ${maven.core.version} - - - org.apache.maven.plugin-tools - maven-plugin-annotations - 3.4 - provided - - - org.apache.maven - maven-compat - ${maven.core.version} - test - - - org.apache.maven.plugin-testing - maven-plugin-testing-harness - test - 3.3.0 - - - - - - junit - junit - test - - - org.hamcrest - hamcrest-all - test - - - org.mockito - mockito-core - test - - - org.powermock - powermock-module-junit4 - ${powermock.version} - test - - - org.powermock - powermock-api-mockito - ${powermock.version} - test - - - org.slf4j - slf4j-log4j12 - test - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - - org.apache.maven.plugins - maven-plugin-plugin - 3.5 - - springmvc-raml - true - - - - mojo-descriptor - process-classes - - descriptor - - - - default-descriptor - - descriptor - - process-classes - - - help-descriptor - - helpmojo - - process-classes - - - - - org.apache.maven.plugins - maven-site-plugin - 3.5.1 - - - attach-descriptor - - attach-descriptor - - - - - - - - - - net.revelc.code.formatter - formatter-maven-plugin - 2.7.1 - - ${project.basedir}/eclipse-formatter-config.xml - AUTO - - - - - validate - - - - - - - - - src/main/resources - true - - - - - src/test/resources - true - - - + + org.springframework.cloud + spring-cloud-starter-openfeign + ${feign.client.version} + true + + + org.springframework.boot + spring-boot-starter-logging + + + + + + javax.servlet + javax.servlet-api + provided + + + + + + org.apache.maven + maven-core + ${maven.core.version} + + + org.apache.maven + maven-plugin-api + ${maven.core.version} + + + org.apache.maven.plugin-tools + maven-plugin-annotations + 3.4 + provided + + + org.apache.maven + maven-compat + ${maven.core.version} + test + + + org.apache.maven.plugin-testing + maven-plugin-testing-harness + test + 3.3.0 + + + + + + junit + junit + test + + + org.hamcrest + hamcrest-all + test + + + org.mockito + mockito-core + test + + + org.powermock + powermock-module-junit4 + ${powermock.version} + test + + + org.powermock + powermock-api-mockito + ${powermock.version} + test + + + org.slf4j + slf4j-log4j12 + test + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-plugin-plugin + 3.5 + + springmvc-raml + true + + + + mojo-descriptor + process-classes + + descriptor + + + + default-descriptor + + descriptor + + process-classes + + + help-descriptor + + helpmojo + + process-classes + + + + + org.apache.maven.plugins + maven-site-plugin + 3.5.1 + + + attach-descriptor + + attach-descriptor + + + + + + + + + + net.revelc.code.formatter + formatter-maven-plugin + 2.7.1 + + ${project.basedir}/eclipse-formatter-config.xml + AUTO + + + + + validate + + + + + + + + + src/main/resources + true + + + + + src/test/resources + true + + + - - - sign - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.6 - - - sign-artifacts - verify - - sign - - - - - - - - + + + sign + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + + + + + - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + diff --git a/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/rules/SpringFeignClientInterfaceRule.java b/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/rules/SpringFeignClientInterfaceRule.java index e0351417..7b174007 100644 --- a/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/rules/SpringFeignClientInterfaceRule.java +++ b/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/rules/SpringFeignClientInterfaceRule.java @@ -12,7 +12,7 @@ */ package com.phoenixnap.oss.ramlplugin.raml2code.rules; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import com.phoenixnap.oss.ramlplugin.raml2code.rules.spring.SpringFeignClientInterfaceDecoratorRule; diff --git a/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/rules/spring/SpringFeignClientClassAnnotationRule.java b/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/rules/spring/SpringFeignClientClassAnnotationRule.java index 13eb5e39..908ab559 100644 --- a/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/rules/spring/SpringFeignClientClassAnnotationRule.java +++ b/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/rules/spring/SpringFeignClientClassAnnotationRule.java @@ -12,7 +12,7 @@ */ package com.phoenixnap.oss.ramlplugin.raml2code.rules.spring; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import com.phoenixnap.oss.ramlplugin.raml2code.data.ApiResourceMetadata; import com.phoenixnap.oss.ramlplugin.raml2code.rules.Rule; diff --git a/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/rules/spring/SpringFeignClientInterfaceDecoratorRule.java b/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/rules/spring/SpringFeignClientInterfaceDecoratorRule.java index 6a195657..bdb1fa7d 100644 --- a/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/rules/spring/SpringFeignClientInterfaceDecoratorRule.java +++ b/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/rules/spring/SpringFeignClientInterfaceDecoratorRule.java @@ -12,7 +12,7 @@ */ package com.phoenixnap.oss.ramlplugin.raml2code.rules.spring; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import com.phoenixnap.oss.ramlplugin.raml2code.data.ApiResourceMetadata; import com.phoenixnap.oss.ramlplugin.raml2code.rules.GenericJavaClassRule; diff --git a/src/test/resources/validations/FeignClient.java.txt b/src/test/resources/validations/FeignClient.java.txt index 606c9a0e..72918c1f 100644 --- a/src/test/resources/validations/FeignClient.java.txt +++ b/src/test/resources/validations/FeignClient.java.txt @@ -127,7 +127,7 @@ package com.gen.test; import java.util.List; import javax.validation.Valid; import com.gen.test.model.Song; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; diff --git a/src/test/resources/validations/FeignClientDefaultValues.java.txt b/src/test/resources/validations/FeignClientDefaultValues.java.txt index ec780964..49ccb019 100644 --- a/src/test/resources/validations/FeignClientDefaultValues.java.txt +++ b/src/test/resources/validations/FeignClientDefaultValues.java.txt @@ -3,7 +3,7 @@ package com.gen.test; import java.math.BigDecimal; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/src/test/resources/validations/github/Issue284FeignClientInterface.java.txt b/src/test/resources/validations/github/Issue284FeignClientInterface.java.txt index 7c9e7911..fff1fcdc 100644 --- a/src/test/resources/validations/github/Issue284FeignClientInterface.java.txt +++ b/src/test/resources/validations/github/Issue284FeignClientInterface.java.txt @@ -3,7 +3,7 @@ package com.gen.test; import java.math.BigDecimal; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestHeader; diff --git a/src/test/resources/validations/github/issue-254/Issue254-FeignClientInterface.java.txt b/src/test/resources/validations/github/issue-254/Issue254-FeignClientInterface.java.txt index 09b68dfb..92c3997f 100644 --- a/src/test/resources/validations/github/issue-254/Issue254-FeignClientInterface.java.txt +++ b/src/test/resources/validations/github/issue-254/Issue254-FeignClientInterface.java.txt @@ -5,7 +5,7 @@ package com.gen.test; import java.math.BigDecimal; import java.util.Date; import javax.validation.Valid; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.HttpHeaders; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; diff --git a/src/test/resources/validations/github/issue-286/Issue286-1Spring4FeignClient.java.txt b/src/test/resources/validations/github/issue-286/Issue286-1Spring4FeignClient.java.txt index 43f251a5..3445bf31 100644 --- a/src/test/resources/validations/github/issue-286/Issue286-1Spring4FeignClient.java.txt +++ b/src/test/resources/validations/github/issue-286/Issue286-1Spring4FeignClient.java.txt @@ -82,7 +82,7 @@ package com.gen.test; import javax.validation.Valid; import com.gen.test.model.User; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; diff --git a/src/test/resources/validations/github/issue-286/Issue286-2Spring4FeignClient.java.txt b/src/test/resources/validations/github/issue-286/Issue286-2Spring4FeignClient.java.txt index 3de52b11..5ab878ed 100644 --- a/src/test/resources/validations/github/issue-286/Issue286-2Spring4FeignClient.java.txt +++ b/src/test/resources/validations/github/issue-286/Issue286-2Spring4FeignClient.java.txt @@ -82,7 +82,7 @@ package com.gen.test; import javax.validation.Valid; import com.gen.test.model.User; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; From 2c94b753071418adbd3058f060c8a6117e75dd65 Mon Sep 17 00:00:00 2001 From: Tobias Brennecke Date: Tue, 8 Jan 2019 22:42:48 +0100 Subject: [PATCH 2/3] Issue #244 revert formatting --- pom.xml | 556 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 278 insertions(+), 278 deletions(-) diff --git a/pom.xml b/pom.xml index 9e8fd993..bef445a6 100644 --- a/pom.xml +++ b/pom.xml @@ -1,296 +1,296 @@ - 4.0.0 - - com.phoenixnap.oss - springmvc-raml-plugin - 2.0.5 - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + com.phoenixnap.oss + springmvc-raml-plugin + 2.0.5 + + io.spring.platform platform-bom Brussels-SR6 - - RAML to Spring MVC code generator - Component is Maven plugin that reads RAML documents and creates Spring MVC endpoints - https://github.com/phoenixnap/springmvc-raml-plugin/tree/master/springmvc-raml-parser - maven-plugin - - - - Aleksandar Stojsavljevic - aleksandars@ccbill.com - CCBill - http://www.ccbill.com - - - - - - The Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - - - - - scm:git:git@github.com:phoenixnap/springmvc-raml-plugin.git - scm:git:git@github.com:phoenixnap/springmvc-raml-plugin.git - git@github.com:phoenixnap/springmvc-raml-plugin.git - - - - UTF-8 - 1.8 - 1.8 - true - - 1.6.2 - 3.3.9 + + RAML to Spring MVC code generator + Component is Maven plugin that reads RAML documents and creates Spring MVC endpoints + https://github.com/phoenixnap/springmvc-raml-plugin/tree/master/springmvc-raml-parser + maven-plugin + + + + Aleksandar Stojsavljevic + aleksandars@ccbill.com + CCBill + http://www.ccbill.com + + + + + + The Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + scm:git:git@github.com:phoenixnap/springmvc-raml-plugin.git + scm:git:git@github.com:phoenixnap/springmvc-raml-plugin.git + git@github.com:phoenixnap/springmvc-raml-plugin.git + + + + UTF-8 + 1.8 + 1.8 + true + + 1.6.2 + 3.3.9 0.5.1 - 1.0.28 - 2.0.2.RELEASE + 1.0.28 + 2.0.2.RELEASE 2.6 - - - - - - commons-io - commons-io - - - - commons-collections - commons-collections - - - - org.raml - raml-parser-2 - ${ramlparser2.version} - - - - org.jsonschema2pojo - jsonschema2pojo-core - ${jsonschema2pojo.version} - + + + + + commons-io + commons-io + + + + commons-collections + commons-collections + + + + org.raml + raml-parser-2 + ${ramlparser2.version} + + + + org.jsonschema2pojo + jsonschema2pojo-core + ${jsonschema2pojo.version} + + com.sun.codemodel codemodel ${codemodel.version} + + + org.springframework.cloud + spring-cloud-starter-openfeign + ${feign.client.version} + true + + + org.springframework.boot + spring-boot-starter-logging + + + + + + javax.servlet + javax.servlet-api + provided + + + + + + org.apache.maven + maven-core + ${maven.core.version} + + + org.apache.maven + maven-plugin-api + ${maven.core.version} + + + org.apache.maven.plugin-tools + maven-plugin-annotations + 3.4 + provided + + + org.apache.maven + maven-compat + ${maven.core.version} + test + + + org.apache.maven.plugin-testing + maven-plugin-testing-harness + test + 3.3.0 + + + + + + junit + junit + test + + + org.hamcrest + hamcrest-all + test + + + org.mockito + mockito-core + test + + + org.powermock + powermock-module-junit4 + ${powermock.version} + test + + + org.powermock + powermock-api-mockito + ${powermock.version} + test + + + org.slf4j + slf4j-log4j12 + test + + - - org.springframework.cloud - spring-cloud-starter-openfeign - ${feign.client.version} - true - - - org.springframework.boot - spring-boot-starter-logging - - - - - - javax.servlet - javax.servlet-api - provided - - - - - - org.apache.maven - maven-core - ${maven.core.version} - - - org.apache.maven - maven-plugin-api - ${maven.core.version} - - - org.apache.maven.plugin-tools - maven-plugin-annotations - 3.4 - provided - - - org.apache.maven - maven-compat - ${maven.core.version} - test - - - org.apache.maven.plugin-testing - maven-plugin-testing-harness - test - 3.3.0 - - - - - - junit - junit - test - - - org.hamcrest - hamcrest-all - test - - - org.mockito - mockito-core - test - - - org.powermock - powermock-module-junit4 - ${powermock.version} - test - - - org.powermock - powermock-api-mockito - ${powermock.version} - test - - - org.slf4j - slf4j-log4j12 - test - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - - org.apache.maven.plugins - maven-plugin-plugin - 3.5 - - springmvc-raml - true - - - - mojo-descriptor - process-classes - - descriptor - - - - default-descriptor - - descriptor - - process-classes - - - help-descriptor - - helpmojo - - process-classes - - - - - org.apache.maven.plugins - maven-site-plugin - 3.5.1 - - - attach-descriptor - - attach-descriptor - - - - - - - - - - net.revelc.code.formatter - formatter-maven-plugin - 2.7.1 - - ${project.basedir}/eclipse-formatter-config.xml - AUTO - - - - - validate - - - - - - - - - src/main/resources - true - - - - - src/test/resources - true - - - + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-plugin-plugin + 3.5 + + springmvc-raml + true + + + + mojo-descriptor + process-classes + + descriptor + + + + default-descriptor + + descriptor + + process-classes + + + help-descriptor + + helpmojo + + process-classes + + + + + org.apache.maven.plugins + maven-site-plugin + 3.5.1 + + + attach-descriptor + + attach-descriptor + + + + + + + + + + net.revelc.code.formatter + formatter-maven-plugin + 2.7.1 + + ${project.basedir}/eclipse-formatter-config.xml + AUTO + + + + + validate + + + + + + + + + src/main/resources + true + + + + + src/test/resources + true + + + - - - sign - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.6 - - - sign-artifacts - verify - - sign - - - - - - - - + + + sign + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + + + + + - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + From 2cb2c415e26c89b4bf1ccf06485003c6c7e8fc10 Mon Sep 17 00:00:00 2001 From: Tobias Brennecke Date: Mon, 21 Jan 2019 04:08:15 +0100 Subject: [PATCH 3/3] =?UTF-8?q?Issue=20#244=20Migration=20to=20Spring=20Bo?= =?UTF-8?q?ot=202.x.x=20*=20Change=20parent=20to=20spring-boot-starter-par?= =?UTF-8?q?ent=202.1.2=20RELEASE=20*=20Remove=20dependencies=20to=20common?= =?UTF-8?q?s-io=20and=20commons-collections=20*=20Upgrade=20maven-plugin-a?= =?UTF-8?q?nnotations=20to=20Version=203.6.0=20*=20Update=20Hamcrest=20Mat?= =?UTF-8?q?chers=20to=20Version=202.1=20*=20Fix=20case=20of=20JsonProperty?= =?UTF-8?q?=20f=C3=BCr=20Issue61RulesTest,=20which=20has=20been=20wrong=20?= =?UTF-8?q?previously?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 26 ++++++------------- .../raml2code/interpreters/PojoBuilder.java | 5 ++-- .../raml2code/rules/AbstractRuleTestBase.java | 9 ++++--- .../github/Issue61BaseClient.java.txt | 2 +- 4 files changed, 17 insertions(+), 25 deletions(-) diff --git a/pom.xml b/pom.xml index bef445a6..3d8c13c0 100644 --- a/pom.xml +++ b/pom.xml @@ -7,11 +7,10 @@ 2.0.5 - io.spring.platform - platform-bom - Brussels-SR6 - - + org.springframework.boot + spring-boot-starter-parent + 2.1.2.RELEASE + RAML to Spring MVC code generator Component is Maven plugin that reads RAML documents and creates Spring MVC endpoints @@ -56,16 +55,6 @@ - - commons-io - commons-io - - - - commons-collections - commons-collections - - org.raml raml-parser-2 @@ -118,7 +107,7 @@ org.apache.maven.plugin-tools maven-plugin-annotations - 3.4 + 3.6.0 provided @@ -140,10 +129,11 @@ junit junit test - + org.hamcrest - hamcrest-all + hamcrest + 2.1 test diff --git a/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/interpreters/PojoBuilder.java b/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/interpreters/PojoBuilder.java index 00daab27..2b773f78 100644 --- a/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/interpreters/PojoBuilder.java +++ b/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/interpreters/PojoBuilder.java @@ -21,9 +21,9 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Optional; import java.util.Set; -import org.apache.commons.collections.MapUtils; import org.raml.v2.api.model.v10.datamodel.DateTimeTypeDeclaration; import org.raml.v2.api.model.v10.datamodel.TypeDeclaration; import org.slf4j.Logger; @@ -324,7 +324,8 @@ public PojoBuilder withCompleteConstructor() { // because default constructor (without fields) is already present Map nonTransientAndNonStaticFields = getNonTransientAndNonStaticFields(); - if (MapUtils.isNotEmpty(nonTransientAndNonStaticFields)) { + // if nonTransientAndNonStaticFields is not empty + if (!Optional.ofNullable(nonTransientAndNonStaticFields).map(Map::isEmpty).orElse(true)) { // Create complete constructor JMethod constructor = this.pojo.constructor(JMod.PUBLIC); Map superParametersToAdd = getSuperParametersToAdd(this.pojo); diff --git a/src/test/java/com/phoenixnap/oss/ramlplugin/raml2code/rules/AbstractRuleTestBase.java b/src/test/java/com/phoenixnap/oss/ramlplugin/raml2code/rules/AbstractRuleTestBase.java index 34a838e5..ae97d79a 100644 --- a/src/test/java/com/phoenixnap/oss/ramlplugin/raml2code/rules/AbstractRuleTestBase.java +++ b/src/test/java/com/phoenixnap/oss/ramlplugin/raml2code/rules/AbstractRuleTestBase.java @@ -20,7 +20,7 @@ import java.util.Set; import org.hamcrest.MatcherAssert; -import org.hamcrest.text.IsEqualIgnoringWhiteSpace; +import org.hamcrest.text.IsEqualCompressingWhiteSpace; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; @@ -146,19 +146,20 @@ protected URI getUri(String resourcePath) throws URISyntaxException { return resource.toURI(); } - public static class IsEqualIgnoringLeadingAndEndingWhiteSpaces extends IsEqualIgnoringWhiteSpace { + public static class IsEqualIgnoringLeadingAndEndingWhiteSpaces extends IsEqualCompressingWhiteSpace { public IsEqualIgnoringLeadingAndEndingWhiteSpaces(String string) { super(string); } - public String stripSpace(String toBeStripped) { + @Override + public String stripSpaces(String toBeStripped) { String result = ""; BufferedReader bufReader = new BufferedReader(new StringReader(toBeStripped)); String line; try { while ((line = bufReader.readLine()) != null) { - result += super.stripSpace(line); + result += super.stripSpaces(line); } } catch (IOException e) { return e.getMessage(); diff --git a/src/test/resources/validations/github/Issue61BaseClient.java.txt b/src/test/resources/validations/github/Issue61BaseClient.java.txt index 6de959e4..e5df1326 100644 --- a/src/test/resources/validations/github/Issue61BaseClient.java.txt +++ b/src/test/resources/validations/github/Issue61BaseClient.java.txt @@ -16,7 +16,7 @@ public class SampleUnit implements Serializable * The type string. * */ - @JsonProperty("t_String") + @JsonProperty("t_string") protected String tString; /**