Skip to content

Commit

Permalink
Issue #244 Migration to Spring Boot 2.x.x
Browse files Browse the repository at this point in the history
* Change parent to spring-boot-starter-parent 2.1.2 RELEASE
* Remove dependencies to commons-io and commons-collections
* Upgrade maven-plugin-annotations to Version 3.6.0
* Update Hamcrest Matchers to Version 2.1
* Fix case of JsonProperty für Issue61RulesTest, which has been wrong previously
  • Loading branch information
Tobias Brennecke committed Jan 21, 2019
1 parent 2c94b75 commit 2cb2c41
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 25 deletions.
26 changes: 8 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
<version>2.0.5</version>

<parent>
<groupId>io.spring.platform</groupId>
<artifactId>platform-bom</artifactId>
<version>Brussels-SR6</version>
<relativePath/>
</parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.2.RELEASE</version>
</parent>

<name>RAML to Spring MVC code generator</name>
<description>Component is Maven plugin that reads RAML documents and creates Spring MVC endpoints</description>
Expand Down Expand Up @@ -56,16 +55,6 @@

<dependencies>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>

<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</dependency>

<dependency>
<groupId>org.raml</groupId>
<artifactId>raml-parser-2</artifactId>
Expand Down Expand Up @@ -118,7 +107,7 @@
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.4</version>
<version>3.6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -140,10 +129,11 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<artifactId>hamcrest</artifactId>
<version>2.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -324,7 +324,8 @@ public PojoBuilder withCompleteConstructor() {
// because default constructor (without fields) is already present
Map<String, JFieldVar> 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<String, JVar> superParametersToAdd = getSuperParametersToAdd(this.pojo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class SampleUnit implements Serializable
* The type string.
*
*/
@JsonProperty("t_String")
@JsonProperty("t_string")
protected String tString;

/**
Expand Down

0 comments on commit 2cb2c41

Please sign in to comment.