Fix build warnings & CLM scan issue 83/65583/3 1.3.1 3.0.0-ONAP
authorVijay VK <vv770d@att.com>
Mon, 10 Sep 2018 18:04:05 +0000 (19:04 +0100)
committerVENKATESH KUMAR <vv770d@att.com>
Tue, 11 Sep 2018 15:35:17 +0000 (11:35 -0400)
Change-Id: I43629917f2d7bafb15258bdbba1cd45478595edb
Signed-off-by: VENKATESH KUMAR <vv770d@att.com>
Issue-ID: DCAEGEN2-603, DCAEGEN2-767
Signed-off-by: VENKATESH KUMAR <vv770d@att.com>
14 files changed:
pom.xml
src/test/java/org/onap/dcae/ApplicationSettingsTest.java
src/test/java/org/onap/dcae/TestingUtilities.java
src/test/java/org/onap/dcae/WiremockBasedTest.java
src/test/java/org/onap/dcae/commonFunction/ApiExceptionTest.java
src/test/java/org/onap/dcae/commonFunction/ConfigProcessorAdapterTest.java
src/test/java/org/onap/dcae/commonFunction/EventProcessorTest.java
src/test/java/org/onap/dcae/controller/ConfigCBSSourceTest.java
src/test/java/org/onap/dcae/controller/ConfigParsingTest.java
src/test/java/org/onap/dcae/controller/EnvPropertiesReaderTest.java
src/test/java/org/onap/dcae/vestest/AnyNodeTest.java
src/test/java/org/onap/dcae/vestest/TestConfigProcessor.java
src/test/java/org/onap/dcae/vestest/TestVESLogger.java
src/test/resources/.gitignore [new file with mode: 0644]

diff --git a/pom.xml b/pom.xml
index 47abc8e..d350396 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -312,6 +312,16 @@ limitations under the License.
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
+                       <dependency>
+                               <groupId>org.apache.tomcat.embed</groupId>
+                               <artifactId>tomcat-embed-core</artifactId>
+                               <version>8.5.32</version>
+                       </dependency>
+                       <dependency>
+                               <groupId>org.apache.tomcat.embed</groupId>
+                               <artifactId>tomcat-embed-el</artifactId>
+                               <version>8.5.32</version>
+                       </dependency>               
         </dependencies>
     </dependencyManagement>
     <dependencies>
index 67b9cb6..55160ff 100644 (file)
@@ -1,10 +1,9 @@
-package org.onap.dcae;
-
 /*-
  * ============LICENSE_START=======================================================
  * org.onap.dcaegen2.collectors.ves
  * ================================================================================
  * Copyright (C) 2018 Nokia. All rights reserved.
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,14 +19,23 @@ package org.onap.dcae;
  * ============LICENSE_END=========================================================
  */
 
+package org.onap.dcae;
+
+import static java.util.Collections.singletonList;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.onap.dcae.CLIUtils.processCmdLine;
+import static org.onap.dcae.TestingUtilities.createTemporaryFile;
+
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.github.fge.jsonschema.core.exceptions.ProcessingException;
 import com.github.fge.jsonschema.main.JsonSchema;
 import io.vavr.collection.HashMap;
 import io.vavr.collection.Map;
-import org.junit.Test;
-
 import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
@@ -35,11 +43,7 @@ import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Arrays;
 import java.util.Objects;
-
-import static java.util.Collections.singletonList;
-import static org.junit.Assert.*;
-import static org.onap.dcae.CLIUtils.processCmdLine;
-import static org.onap.dcae.TestingUtilities.createTemporaryFile;
+import org.junit.Test;
 
 public class ApplicationSettingsTest {
 
@@ -290,12 +294,12 @@ public class ApplicationSettingsTest {
     @Test
     public void shouldReturnJSONSchema() throws IOException, ProcessingException {
         // when
-        String sampleJsonSchema = "{" +
-            "  \"type\": \"object\"," +
-            "  \"properties\": {" +
-            "     \"state\": { \"type\": \"string\" }" +
-            "  }" +
-            "}";
+        String sampleJsonSchema = "{"
+            + "  \"type\": \"object\","
+            + "  \"properties\": {"
+            + "     \"state\": { \"type\": \"string\" }" 
+            + "  }" 
+            "}";
         Path temporarySchemaFile = createTemporaryFile(sampleJsonSchema);
 
         // when
index 21edfc8..bd05c4e 100644 (file)
@@ -3,6 +3,7 @@
  * org.onap.dcaegen2.collectors.ves
  * ================================================================================
  * Copyright (C) 2018 Nokia. All rights reserved.
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 package org.onap.dcae;
 
-import io.vavr.control.Try;
-import org.assertj.core.api.AbstractThrowableAssert;
-import org.assertj.core.api.Java6Assertions;
-import org.json.JSONObject;
+import static java.nio.file.Files.readAllBytes;
+import static org.assertj.core.api.Assertions.assertThat;
 
+import io.vavr.control.Try;
 import java.io.File;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
-
-import static java.nio.file.Files.readAllBytes;
-import static org.assertj.core.api.Assertions.assertThat;
+import org.assertj.core.api.AbstractThrowableAssert;
+import org.assertj.core.api.Java6Assertions;
+import org.json.JSONObject;
 
 /**
  * @author Pawel Szalapski (pawel.szalapski@nokia.com)
index 5862634..3b4bdc3 100644 (file)
@@ -3,6 +3,7 @@
  * org.onap.dcaegen2.collectors.ves
  * ================================================================================
  * Copyright (C) 2018 Nokia. All rights reserved.
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package org.onap.dcae;
 
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
+import static io.vavr.API.Map;
+
 import com.github.tomakehurst.wiremock.junit.WireMockRule;
 import io.vavr.collection.Map;
 import org.junit.Rule;
 
-import static com.github.tomakehurst.wiremock.client.WireMock.*;
-import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
-import static io.vavr.API.Map;
-
 /**
  * @author Pawel Szalapski (pawel.szalapski@nokia.com)
  */
index ef5b477..a63e97f 100644 (file)
@@ -17,6 +17,7 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.dcae.commonFunction;
 
 import static org.junit.Assert.assertEquals;
index 180dfcf..1ad5589 100644 (file)
 //
 package org.onap.dcae.commonFunction;
 
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
 import org.json.JSONObject;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -26,11 +31,6 @@ import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
 
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
 @RunWith(MockitoJUnitRunner.class)
 public class ConfigProcessorAdapterTest {
 
index 3e35846..697510c 100644 (file)
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.dcae.commonFunction;
 
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.onap.dcae.commonFunction.EventProcessor.EVENT_LIST_TYPE;
+
 import com.google.gson.Gson;
-import io.vavr.collection.Map;
+import java.util.List;
 import org.json.JSONObject;
 import org.junit.Before;
 import org.junit.Test;
@@ -30,13 +40,6 @@ import org.onap.dcae.ApplicationSettings;
 import org.onap.dcae.CLIUtils;
 import org.onap.dcae.commonFunction.event.publishing.EventPublisher;
 
-import java.util.List;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.*;
-import static org.onap.dcae.commonFunction.EventProcessor.EVENT_LIST_TYPE;
 
 public class EventProcessorTest {
 
index bee2cce..bfec3d9 100644 (file)
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.dcae.controller;
 
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static org.assertj.core.api.Java6Assertions.assertThat;
+import static org.onap.dcae.TestingUtilities.assertFailureHasInfo;
+import static org.onap.dcae.controller.ConfigSource.getAppConfig;
+
 import io.vavr.control.Try;
 import org.json.JSONObject;
 import org.junit.Test;
 import org.onap.dcae.WiremockBasedTest;
 
-import static com.github.tomakehurst.wiremock.client.WireMock.*;
-import static org.assertj.core.api.Java6Assertions.assertThat;
-import static org.onap.dcae.TestingUtilities.assertFailureHasInfo;
-import static org.onap.dcae.controller.ConfigSource.getAppConfig;
 
 public class ConfigCBSSourceTest extends WiremockBasedTest {
 
index a00a3d3..5d8d4ef 100644 (file)
@@ -18,6 +18,7 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.dcae.controller;
 
 
index 581f6ea..6c35802 100644 (file)
@@ -18,6 +18,7 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.dcae.controller;
 
 import static io.vavr.API.Map;
index 9400e46..52f8127 100644 (file)
@@ -17,6 +17,7 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.dcae.vestest;
 
 import static org.assertj.core.api.Assertions.assertThat;
index eaf5941..79ae9ef 100644 (file)
@@ -22,16 +22,14 @@ package org.onap.dcae.vestest;
 import static org.junit.Assert.assertEquals;\r
 import static org.junit.Assert.assertNotEquals;\r
 \r
-import com.google.gson.JsonParser;\r
 import com.google.gson.JsonObject;\r
+import com.google.gson.JsonParser;\r
 import java.io.FileReader;\r
 import java.io.IOException;\r
 import org.json.JSONObject;\r
 import org.junit.Test;\r
-\r
 import org.onap.dcae.commonFunction.ConfigProcessors;\r
 \r
-\r
 public class TestConfigProcessor {\r
 \r
     private JSONObject getFileAsJsonObject() {\r
index 848f2b7..a1b3e7d 100644 (file)
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.dcae.vestest;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.onap.dcae.commonFunction.VESLogger.REQUEST_ID;
+
 import com.att.nsa.logging.LoggingContext;
 import com.att.nsa.logging.log4j.EcompFields;
+import java.util.UUID;
 import org.junit.Test;
 import org.onap.dcae.commonFunction.VESLogger;
 
-import java.util.UUID;
-
-import static org.junit.Assert.*;
-import static org.onap.dcae.commonFunction.VESLogger.REQUEST_ID;
-
 public class TestVESLogger {
 
     @Test
diff --git a/src/test/resources/.gitignore b/src/test/resources/.gitignore
new file mode 100644 (file)
index 0000000..84ac2eb
--- /dev/null
@@ -0,0 +1,2 @@
+/controller-config_formatted_op.json
+/DmaapConfig-op.json