summaryrefslogtreecommitdiffstats
path: root/saltstack-adapter/saltstack-adapter-provider/src/test
diff options
context:
space:
mode:
authorGanesh Chandrasekaran <ganesh.c@samsung.com>2018-07-13 09:41:32 +0900
committerGanesh Chandrasekaran <ganesh.c@samsung.com>2018-07-16 16:24:56 +0900
commit3323c0829fa0492a5c7b3544a83cc24412c9934c (patch)
tree421b5d254821a24d63869b8c6651ea74a562d1ea /saltstack-adapter/saltstack-adapter-provider/src/test
parent3c36ac2ba101ec0cc596c15bfd45efcc731f442f (diff)
saltstack adaptor fixes from Sonar
Issue-ID: CCSDK-364 Change-Id: Ief9705370d84fcb99fcb718f03c31e6cbfd47363 Signed-off-by: Ganesh Chandrasekaran <ganesh.c@samsung.com>
Diffstat (limited to 'saltstack-adapter/saltstack-adapter-provider/src/test')
-rw-r--r--saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestConnectionBuilder.java (renamed from saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/appc/adapter/impl/TestConnectionBuilder.java)13
-rw-r--r--saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterImpl.java (renamed from saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/appc/adapter/impl/TestSaltstackAdapterImpl.java)16
-rw-r--r--saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterPropertiesProviderImpl.java (renamed from saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/appc/adapter/impl/TestSaltstackAdapterPropertiesProviderImpl.java)7
-rw-r--r--saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/model/TestJsonParser.java (renamed from saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/appc/adapter/model/TestJsonParser.java)2
-rw-r--r--saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/model/TestSaltstackAdapter.java (renamed from saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/appc/adapter/model/TestSaltstackAdapter.java)6
-rw-r--r--saltstack-adapter/saltstack-adapter-provider/src/test/resources/org/onap/ccsdk/default.properties (renamed from saltstack-adapter/saltstack-adapter-provider/src/test/resources/org/onap/appc/default.properties)0
6 files changed, 5 insertions, 39 deletions
diff --git a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/appc/adapter/impl/TestConnectionBuilder.java b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestConnectionBuilder.java
index d9a384141..933f3fcf7 100644
--- a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/appc/adapter/impl/TestConnectionBuilder.java
+++ b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestConnectionBuilder.java
@@ -22,7 +22,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.appc.adapter.impl;
+package org.onap.ccsdk.adapter.impl;
import org.junit.After;
import org.junit.Before;
@@ -41,21 +41,12 @@ import static org.junit.Assert.fail;
public class TestConnectionBuilder {
- private final String PENDING = "100";
- private final String SUCCESS = "400";
- private String message = "{\"Results\":{\"192.168.1.10\":{\"Id\":\"101\",\"StatusCode\":200,\"StatusMessage\":\"SUCCESS\"}},\"StatusCode\":200,\"StatusMessage\":\"FINISHED\"}";
-
private ConnectionBuilder connBuilder;
- private String TestId;
- private boolean testMode = true;
private Map<String, String> params;
- private SvcLogicContext svcContext;
@Before
public void setup() throws IllegalArgumentException {
- testMode = true;
- svcContext = new SvcLogicContext();
String HostName = "test";
String Port = "10";
String User = "test";
@@ -70,10 +61,8 @@ public class TestConnectionBuilder {
@After
public void tearDown() {
- testMode = false;
connBuilder = null;
params = null;
- svcContext = null;
}
@Test
diff --git a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/appc/adapter/impl/TestSaltstackAdapterImpl.java b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterImpl.java
index d60059e40..0622a4716 100644
--- a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/appc/adapter/impl/TestSaltstackAdapterImpl.java
+++ b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterImpl.java
@@ -22,7 +22,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.appc.adapter.impl;
+package org.onap.ccsdk.adapter.impl;
import org.junit.After;
import org.junit.Before;
@@ -40,10 +40,6 @@ import static org.junit.Assert.fail;
public class TestSaltstackAdapterImpl {
- private final String PENDING = "100";
- private final String SUCCESS = "400";
- private String message = "{\"Results\":{\"192.168.1.10\":{\"Id\":\"101\",\"StatusCode\":200,\"StatusMessage\":\"SUCCESS\"}},\"StatusCode\":200,\"StatusMessage\":\"FINISHED\"}";
-
private SaltstackAdapterImpl adapter;
private String TestId;
private boolean testMode = true;
@@ -457,7 +453,6 @@ public class TestSaltstackAdapterImpl {
params.put("Id", "test1");
adapter.reqExecSLSFile(params, svcContext);
- String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
assertEquals(TestId, "test1");
}
@@ -476,7 +471,6 @@ public class TestSaltstackAdapterImpl {
params.put("Id", "test1");
adapter.reqExecSLSFile(params, svcContext);
- String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
assertEquals(TestId, "test1");
}
@@ -495,7 +489,6 @@ public class TestSaltstackAdapterImpl {
params.put("Id", "test1");
adapter.reqExecSLSFile(params, svcContext);
- String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
assertEquals(TestId, "test1");
}
@@ -559,7 +552,6 @@ public class TestSaltstackAdapterImpl {
params.put("applyTo", "minion1");
adapter.reqExecSLSFile(params, svcContext);
- String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
assertEquals(TestId, "test1");
}
@@ -579,7 +571,6 @@ public class TestSaltstackAdapterImpl {
params.put("applyTo", "minion1");
adapter.reqExecSLSFile(params, svcContext);
- String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
assertEquals(TestId, "test1");
}
@@ -621,7 +612,6 @@ public class TestSaltstackAdapterImpl {
params.put("applyTo", "*");
adapter.reqExecSLSFile(params, svcContext);
- String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
assertEquals(TestId, "test1");
}
@@ -641,7 +631,6 @@ public class TestSaltstackAdapterImpl {
params.put("applyTo", "*");
adapter.reqExecSLSFile(params, svcContext);
- String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
assertEquals(TestId, "test1");
}
@@ -703,7 +692,6 @@ public class TestSaltstackAdapterImpl {
params.put("Id", "test1");
adapter.reqExecSLS(params, svcContext);
- String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
assertEquals(TestId, "test1");
}
@@ -747,7 +735,6 @@ public class TestSaltstackAdapterImpl {
params.put("applyTo", "minion1");
adapter.reqExecSLS(params, svcContext);
- String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
assertEquals(TestId, "test1");
}
@@ -790,7 +777,6 @@ public class TestSaltstackAdapterImpl {
params.put("applyTo", "*");
adapter.reqExecSLS(params, svcContext);
- String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
assertEquals(TestId, "test1");
}
diff --git a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/appc/adapter/impl/TestSaltstackAdapterPropertiesProviderImpl.java b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterPropertiesProviderImpl.java
index 927591830..094e78c79 100644
--- a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/appc/adapter/impl/TestSaltstackAdapterPropertiesProviderImpl.java
+++ b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterPropertiesProviderImpl.java
@@ -22,7 +22,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.appc.adapter.impl;
+package org.onap.ccsdk.adapter.impl;
import org.junit.After;
import org.junit.Before;
@@ -37,13 +37,9 @@ import java.util.Properties;
import static org.junit.Assert.assertEquals;
public class TestSaltstackAdapterPropertiesProviderImpl {
- private final String PENDING = "100";
- private final String SUCCESS = "400";
- private String message = "{\"Results\":{\"192.168.1.10\":{\"Id\":\"101\",\"StatusCode\":200,\"StatusMessage\":\"SUCCESS\"}},\"StatusCode\":200,\"StatusMessage\":\"FINISHED\"}";
private SaltstackAdapterImpl adapter;
private Properties params;
- private SvcLogicContext svcContext;
@Before
@@ -55,7 +51,6 @@ public class TestSaltstackAdapterPropertiesProviderImpl {
public void tearDown() {
adapter = null;
params = null;
- svcContext = null;
}
@Test(expected = SvcLogicException.class)
diff --git a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/appc/adapter/model/TestJsonParser.java b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/model/TestJsonParser.java
index ae13da6c8..74e7ed0c4 100644
--- a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/appc/adapter/model/TestJsonParser.java
+++ b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/model/TestJsonParser.java
@@ -19,7 +19,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.appc.adapter.model;
+package org.onap.ccsdk.adapter.model;
import org.codehaus.jettison.json.JSONException;
import org.junit.Test;
diff --git a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/appc/adapter/model/TestSaltstackAdapter.java b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/model/TestSaltstackAdapter.java
index 37b6502ca..0caaf3320 100644
--- a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/appc/adapter/model/TestSaltstackAdapter.java
+++ b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/model/TestSaltstackAdapter.java
@@ -21,7 +21,7 @@
* ECOMP is a trademark and service mark of AT&T Intellectual Property.
* ============LICENSE_END=========================================================
*/
-package org.onap.appc.adapter.model;
+package org.onap.ccsdk.adapter.model;
import org.junit.Test;
import org.onap.ccsdk.sli.adaptors.saltstack.model.SaltstackMessageParser;
@@ -39,7 +39,6 @@ public class TestSaltstackAdapter {
private Class[] parameterTypes;
private SaltstackMessageParser saltstackMessageParser;
private Method m;
- private String name;
@Test
public void callPrivateConstructorsMethodsForCodeCoverage() throws SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException {
@@ -48,21 +47,18 @@ public class TestSaltstackAdapter {
Class<?>[] classesOne = {SaltstackMessageParser.class};
for(Class<?> clazz : classesOne) {
Constructor<?> constructor = clazz.getDeclaredConstructor();
- name = constructor.getName();
constructor.setAccessible(true);
assertNotNull(constructor.newInstance());
}
Class<?>[] classesTwo = {SaltstackServerEmulator.class};
for(Class<?> clazz : classesTwo) {
Constructor<?> constructor = clazz.getDeclaredConstructor();
- name = constructor.getName();
constructor.setAccessible(true);
assertNotNull(constructor.newInstance());
}
Class<?>[] classesThree = {SaltstackResult.class};
for(Class<?> clazz : classesThree) {
Constructor<?> constructor = clazz.getDeclaredConstructor();
- name = constructor.getName();
constructor.setAccessible(true);
assertNotNull(constructor.newInstance());
}
diff --git a/saltstack-adapter/saltstack-adapter-provider/src/test/resources/org/onap/appc/default.properties b/saltstack-adapter/saltstack-adapter-provider/src/test/resources/org/onap/ccsdk/default.properties
index 2f8fb4585..2f8fb4585 100644
--- a/saltstack-adapter/saltstack-adapter-provider/src/test/resources/org/onap/appc/default.properties
+++ b/saltstack-adapter/saltstack-adapter-provider/src/test/resources/org/onap/ccsdk/default.properties