Skip to content

Commit f56a993

Browse files
authored
Pom cleanup, uplift dependencies, removed some warnings during maven build (#37)
1 parent 3c1a089 commit f56a993

22 files changed

+142
-70
lines changed

pom.xml

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
<parent>
99
<groupId>org.springframework.boot</groupId>
1010
<artifactId>spring-boot-starter-parent</artifactId>
11-
<version>1.5.4.RELEASE</version>
11+
<version>1.5.5.RELEASE</version>
1212
<relativePath/> <!-- .. lookup parent from repository -->
1313
</parent>
1414

1515
<properties>
1616
<java.version>1.8</java.version>
17-
<plugin-version>0.8.6</plugin-version>
17+
<plugin-version>0.10.11</plugin-version>
1818
<output-relative-path>src/main/java</output-relative-path>
1919
<raml-path>src/main/resources/public/raml/subscription.raml</raml-path>
2020
<raml-path>src/main/resources/public/raml/instance_info.raml</raml-path>
@@ -73,7 +73,7 @@
7373
<dependency>
7474
<groupId>com.fasterxml.jackson.core</groupId>
7575
<artifactId>jackson-databind</artifactId>
76-
<version>2.8.3</version>
76+
<version>2.8.9</version>
7777
</dependency>
7878

7979
<dependency>
@@ -102,11 +102,11 @@
102102
<version>1.10.19</version>
103103
</dependency>
104104

105-
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-io -->
105+
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
106106
<dependency>
107-
<groupId>org.apache.commons</groupId>
107+
<groupId>commons-io</groupId>
108108
<artifactId>commons-io</artifactId>
109-
<version>1.3.2</version>
109+
<version>2.5</version>
110110
</dependency>
111111

112112
<!-- <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId>
@@ -135,10 +135,6 @@
135135
<groupId>joda-time</groupId>
136136
<artifactId>joda-time</artifactId>
137137
</dependency>
138-
<dependency>
139-
<groupId>com.fasterxml.jackson.core</groupId>
140-
<artifactId>jackson-databind</artifactId>
141-
</dependency>
142138
<dependency>
143139
<groupId>commons-lang</groupId>
144140
<artifactId>commons-lang</artifactId>
@@ -175,6 +171,7 @@
175171
<version>1.16.16</version>
176172
<scope>provided</scope>
177173
</dependency>
174+
178175
</dependencies>
179176
<build>
180177
<plugins>
@@ -200,13 +197,19 @@
200197
<baseUri>/</baseUri>
201198
<seperateMethodsByContentType>false</seperateMethodsByContentType>
202199
<useJackson1xCompatibility>false</useJackson1xCompatibility>
200+
<rule>com.phoenixnap.oss.ramlapisync.generation.rules.Spring4ControllerInterfaceRule</rule>
203201
</configuration>
202+
<executions>
203+
<execution>
204+
<id>generate-springmvc-controllers</id>
205+
<phase>generate-sources</phase>
206+
<goals>
207+
<goal>generate-springmvc-endpoints</goal>
208+
</goals>
209+
</execution>
210+
</executions>
204211
</plugin>
205-
<!-- Required to build the executable jar file -->
206-
<plugin>
207-
<groupId>org.springframework.boot</groupId>
208-
<artifactId>spring-boot-maven-plugin</artifactId>
209-
</plugin>
212+
210213
<!-- required for adding generated sources -->
211214
<plugin>
212215
<groupId>org.codehaus.mojo</groupId>
@@ -226,22 +229,6 @@
226229
</execution>
227230
</executions>
228231
</plugin>
229-
<plugin>
230-
<groupId>com.phoenixnap.oss</groupId>
231-
<artifactId>springmvc-raml-plugin</artifactId>
232-
<configuration>
233-
<rule>com.phoenixnap.oss.ramlapisync.generation.rules.Spring4ControllerInterfaceRule</rule>
234-
</configuration>
235-
<executions>
236-
<execution>
237-
<id>generate-springmvc-controllers</id>
238-
<phase>generate-sources</phase>
239-
<goals>
240-
<goal>generate-springmvc-endpoints</goal>
241-
</goals>
242-
</execution>
243-
</executions>
244-
</plugin>
245232

246233
<plugin>
247234
<groupId>org.apache.maven.plugins</groupId>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
package com.ericsson.ei.controller;
3+
4+
import com.ericsson.ei.controller.model.ParseInstanceInfo;
5+
import org.springframework.http.ResponseEntity;
6+
import org.springframework.web.bind.annotation.RequestMapping;
7+
import org.springframework.web.bind.annotation.RequestMethod;
8+
import org.springframework.web.bind.annotation.RestController;
9+
10+
11+
/**
12+
* Provides interaction with InstanceInfo resource
13+
*
14+
* (Generated with springmvc-raml-parser v.0.10.11)
15+
*
16+
*/
17+
@RestController
18+
@RequestMapping(value = "/information", produces = "application/json")
19+
public interface InformationController {
20+
21+
22+
/**
23+
* List of all instance information
24+
*
25+
*
26+
*/
27+
@RequestMapping(value = "", method = RequestMethod.GET)
28+
public ResponseEntity<ParseInstanceInfo> getInformation();
29+
30+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
package com.ericsson.ei.controller.model;
3+
4+
import java.util.HashMap;
5+
import java.util.Map;
6+
import com.fasterxml.jackson.annotation.JsonAnyGetter;
7+
import com.fasterxml.jackson.annotation.JsonAnySetter;
8+
import com.fasterxml.jackson.annotation.JsonIgnore;
9+
import com.fasterxml.jackson.annotation.JsonInclude;
10+
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
11+
import org.apache.commons.lang.builder.EqualsBuilder;
12+
import org.apache.commons.lang.builder.HashCodeBuilder;
13+
import org.apache.commons.lang.builder.ToStringBuilder;
14+
15+
@JsonInclude(JsonInclude.Include.NON_NULL)
16+
@JsonPropertyOrder({
17+
18+
})
19+
public class ParseInstanceInfo {
20+
21+
@JsonIgnore
22+
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
23+
24+
@Override
25+
public String toString() {
26+
return ToStringBuilder.reflectionToString(this);
27+
}
28+
29+
@JsonAnyGetter
30+
public Map<String, Object> getAdditionalProperties() {
31+
return this.additionalProperties;
32+
}
33+
34+
@JsonAnySetter
35+
public void setAdditionalProperty(String name, Object value) {
36+
this.additionalProperties.put(name, value);
37+
}
38+
39+
@Override
40+
public int hashCode() {
41+
return new HashCodeBuilder().append(additionalProperties).toHashCode();
42+
}
43+
44+
@Override
45+
public boolean equals(Object other) {
46+
if (other == this) {
47+
return true;
48+
}
49+
if ((other instanceof ParseInstanceInfo) == false) {
50+
return false;
51+
}
52+
ParseInstanceInfo rhs = ((ParseInstanceInfo) other);
53+
return new EqualsBuilder().append(additionalProperties, rhs.additionalProperties).isEquals();
54+
}
55+
56+
}

src/main/java/com/ericsson/ei/mongodbhandler/MongoDBHandler.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public class MongoDBHandler {
4141

4242
MongoClient mongoClient;
4343

44+
4445
public void setMongoClient(MongoClient mongoClient) {
4546
this.mongoClient = mongoClient;
4647
}
@@ -60,14 +61,12 @@ public void setMongoClient(MongoClient mongoClient) {
6061
}
6162

6263
//Establishing the connection to mongodb and creating a collection
63-
public void createConnection(String host, int port){
64-
mongoClient = new MongoClient(host , port);
65-
}
66-
64+
public void createConnection(String host, int port){ mongoClient = new MongoClient(host , port);}
6765
//Insert data into collection
6866
public boolean insertDocument(String dataBaseName, String collectionName, String input){
6967
try {
7068
DB db = mongoClient.getDB(dataBaseName);
69+
7170
DBCollection table = db.getCollection(collectionName);
7271
DBObject dbObjectInput = (DBObject) JSON.parse(input);
7372
WriteResult result = table.insert(dbObjectInput);

src/test/java/com/ericsson/ei/extraction/test/TestExtractionHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ public class TestExtractionHandler {
5757
@Test
5858
public void testExtractContent() {
5959
try {
60-
String outputFileContents = FileUtils.readFileToString(new File(outputFilePath));
61-
String rulesFileContents = FileUtils.readFileToString(new File(rulesFilePath));
62-
event = FileUtils.readFileToString(new File(eventFilePath));
60+
String outputFileContents = FileUtils.readFileToString(new File(outputFilePath), "UTF-8");
61+
String rulesFileContents = FileUtils.readFileToString(new File(rulesFilePath), "UTF-8");
62+
event = FileUtils.readFileToString(new File(eventFilePath), "UTF-8");
6363

6464
ObjectMapper objectmapper = new ObjectMapper();
6565
expectedOutput = objectmapper.readTree(outputFileContents);

src/test/java/com/ericsson/ei/flowtests/FlowTest2.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ protected ArrayList<String> getEventNamesToSend() {
5858
protected void checkResult() {
5959
try {
6060
String document = objectHandler.findObjectById("6acc3c87-75e0-4b6d-88f5-b1a5d4e62b43");
61-
String expectedDocument = FileUtils.readFileToString(new File(inputFilePath));
61+
String expectedDocument = FileUtils.readFileToString(new File(inputFilePath), "UTF-8");
6262
ObjectMapper objectmapper = new ObjectMapper();
6363
JsonNode expectedJson = objectmapper.readTree(expectedDocument);
6464
JsonNode actualJson = objectmapper.readTree(document);
6565
String breakString = "breakHere";
6666
assertEquals(expectedJson.toString().length(), actualJson.toString().length());
67-
String expectedDocument2 = FileUtils.readFileToString(new File(inputFilePath2));
67+
String expectedDocument2 = FileUtils.readFileToString(new File(inputFilePath2), "UTF-8");
6868
String document2 = objectHandler.findObjectById("ccce572c-c364-441e-abc9-b62fed080ca2");
6969
JsonNode expectedJson2 = objectmapper.readTree(expectedDocument2);
7070
JsonNode actualJson2 = objectmapper.readTree(document2);

src/test/java/com/ericsson/ei/flowtests/FlowTestBase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public static void setUpMessageBus() throws Exception {
132132
System.setProperty("waitlist.fixedRateResend", "10");
133133

134134
String config = "src/test/resources/configs/qpidConfig.json";
135-
jsonFileContent = FileUtils.readFileToString(new File(jsonFilePath));
135+
jsonFileContent = FileUtils.readFileToString(new File(jsonFilePath), "UTF-8");
136136
ObjectMapper objectmapper = new ObjectMapper();
137137
parsedJason = objectmapper.readTree(jsonFileContent);
138138
qpidConfig = new File(config);
@@ -230,7 +230,7 @@ protected void checkResult() {
230230
String document = objectHandler.findObjectById("6acc3c87-75e0-4b6d-88f5-b1a5d4e62b43");
231231
String expectedDocument;
232232
try {
233-
expectedDocument = FileUtils.readFileToString(new File(inputFilePath));
233+
expectedDocument = FileUtils.readFileToString(new File(inputFilePath), "UTF-8");
234234
ObjectMapper objectmapper = new ObjectMapper();
235235
JsonNode expectedJson = objectmapper.readTree(expectedDocument);
236236
JsonNode actualJson = objectmapper.readTree(document);

src/test/java/com/ericsson/ei/flowtests/FlowTestExternalComposition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected ArrayList<String> getEventNamesToSend() {
4949

5050
protected void checkResult() {
5151
try {
52-
String expectedDocuments = FileUtils.readFileToString(new File(inputFilePath));
52+
String expectedDocuments = FileUtils.readFileToString(new File(inputFilePath), "UTF-8");
5353
ObjectMapper objectmapper = new ObjectMapper();
5454
JsonNode expectedJsons = objectmapper.readTree(expectedDocuments);
5555
JsonNode expectedJson1 = expectedJsons.get(0);

src/test/java/com/ericsson/ei/flowtests/TrafficGeneratedTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public static void setUpMessageBus() throws Exception {
141141

142142

143143
String config = "src/test/resources/configs/qpidConfig.json";
144-
jsonFileContent = FileUtils.readFileToString(new File(jsonFilePath));
144+
jsonFileContent = FileUtils.readFileToString(new File(jsonFilePath), "UTF-8");
145145
ObjectMapper objectmapper = new ObjectMapper();
146146
parsedJason = objectmapper.readTree(jsonFileContent);
147147
qpidConfig = new File(config);
@@ -209,7 +209,7 @@ public void trafficGeneratedTest() {
209209
long timeAfter = System.currentTimeMillis();
210210
long diffTime = timeAfter - timeBefore;
211211

212-
String expectedDocument = FileUtils.readFileToString(new File(inputFilePath));
212+
String expectedDocument = FileUtils.readFileToString(new File(inputFilePath), "UTF-8");
213213
ObjectMapper objectmapper = new ObjectMapper();
214214
JsonNode expectedJson = objectmapper.readTree(expectedDocument);
215215
for (int i = 0; i < EVENT_PACKAGES; i++) {

src/test/java/com/ericsson/ei/handlers/test/ObjectHandlerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public static void init() throws Exception
109109

110110

111111
try {
112-
String rulesString = FileUtils.readFileToString(new File(inputFilePath));
112+
String rulesString = FileUtils.readFileToString(new File(inputFilePath), "UTF-8");
113113
ObjectMapper objectmapper = new ObjectMapper();
114114
rulesJson = objectmapper.readTree(rulesString);
115115
} catch (Exception e) {

0 commit comments

Comments
 (0)