aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions/model-impl/sdc
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-06-14 19:20:55 -0400
committerJim Hahn <jrh3@att.com>2019-06-17 12:31:32 -0400
commitba6267f5bd58dd7a3a0d6363e7ac4c27705e9f40 (patch)
tree658afb8b0500180302e837b0f90e0372c82b7062 /models-interactions/model-impl/sdc
parentf59ec395bf1e41df894f884e70ff3185280668c0 (diff)
Fix sonar issues in models: sdc to vfc
sdc sdnc snr so vfc Still haven't done the "rest" project yet, as still awaiting removal of www.examples.org. Change-Id: Icc4948799e2423bd4568232ee5629b88b7ecb996 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-impl/sdc')
-rw-r--r--models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ResourceInstanceTest.java22
-rw-r--r--models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ResourceTest.java9
-rw-r--r--models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ServiceInstanceTest.java22
-rw-r--r--models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ServiceTest.java9
4 files changed, 38 insertions, 24 deletions
diff --git a/models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ResourceInstanceTest.java b/models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ResourceInstanceTest.java
index 940963565..8ae0084f6 100644
--- a/models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ResourceInstanceTest.java
+++ b/models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ResourceInstanceTest.java
@@ -30,6 +30,10 @@ import org.junit.Test;
public class ResourceInstanceTest {
+ private static final String RESOURCE = "resource";
+ private static final String INSTANCE = "instance";
+ private static final String VERSION_000 = "0.0.0";
+
@Test
public void testConstructors() {
ResourceInstance ri = new ResourceInstance();
@@ -111,11 +115,11 @@ public class ResourceInstanceTest {
assertTrue(ri1.equals(ri2));
assertTrue(ri2.equals(ri1));
- ri1.setResourceInstanceName("instance");
- ri1.setResourceName("resource");
+ ri1.setResourceInstanceName(INSTANCE);
+ ri1.setResourceName(RESOURCE);
ri1.setResourceInvariantUUID(UUID.randomUUID());
ri1.setResourceInvariantUUID(UUID.randomUUID());
- ri1.setResourceVersion("0.0.0");
+ ri1.setResourceVersion(VERSION_000);
ri1.setResourceType(ResourceType.VL);
ri2 = new ResourceInstance(ri1);
assertTrue(ri1.equals(ri2));
@@ -128,11 +132,11 @@ public class ResourceInstanceTest {
ResourceInstance ri2 = new ResourceInstance(ri1);
assertEquals(ri1.toString(), ri2.toString());
- ri1.setResourceInstanceName("instance");
- ri1.setResourceName("resource");
+ ri1.setResourceInstanceName(INSTANCE);
+ ri1.setResourceName(RESOURCE);
ri1.setResourceInvariantUUID(UUID.randomUUID());
ri1.setResourceInvariantUUID(UUID.randomUUID());
- ri1.setResourceVersion("0.0.0");
+ ri1.setResourceVersion(VERSION_000);
ri1.setResourceType(ResourceType.VL);
ri2 = new ResourceInstance(ri1);
assertEquals(ri1.toString(), ri2.toString());
@@ -144,11 +148,11 @@ public class ResourceInstanceTest {
ResourceInstance ri2 = new ResourceInstance(ri1);
assertEquals(ri1.hashCode(), ri2.hashCode());
- ri1.setResourceInstanceName("instance");
- ri1.setResourceName("resource");
+ ri1.setResourceInstanceName(INSTANCE);
+ ri1.setResourceName(RESOURCE);
ri1.setResourceInvariantUUID(UUID.randomUUID());
ri1.setResourceInvariantUUID(UUID.randomUUID());
- ri1.setResourceVersion("0.0.0");
+ ri1.setResourceVersion(VERSION_000);
ri1.setResourceType(ResourceType.VL);
ri2 = new ResourceInstance(ri1);
assertEquals(ri1.hashCode(), ri2.hashCode());
diff --git a/models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ResourceTest.java b/models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ResourceTest.java
index 60510a1d1..6949a36f8 100644
--- a/models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ResourceTest.java
+++ b/models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ResourceTest.java
@@ -30,6 +30,9 @@ import org.junit.Test;
public class ResourceTest {
+ private static final String EQUALS_TEST = "equalsTest";
+ private static final String VERSION_111 = "1.1.1";
+
@Test
public void testConstructors() {
Resource res = new Resource();
@@ -120,7 +123,7 @@ public class ResourceTest {
assertTrue(r1.equals(r2));
assertTrue(r2.equals(r1));
- r1 = new Resource(UUID.randomUUID(), UUID.randomUUID(), "equalsTest", "1.1.1",
+ r1 = new Resource(UUID.randomUUID(), UUID.randomUUID(), EQUALS_TEST, VERSION_111,
ResourceType.VFC);
r2 = new Resource(r1);
assertTrue(r1.equals(r2));
@@ -133,7 +136,7 @@ public class ResourceTest {
Resource r2 = new Resource(r1);
assertEquals(r1.toString(), r2.toString());
- r1 = new Resource(UUID.randomUUID(), UUID.randomUUID(), "equalsTest", "1.1.1",
+ r1 = new Resource(UUID.randomUUID(), UUID.randomUUID(), EQUALS_TEST, VERSION_111,
ResourceType.VFC);
r2 = new Resource(r1);
assertEquals(r1.toString(), r2.toString());
@@ -145,7 +148,7 @@ public class ResourceTest {
Resource r2 = new Resource(r1);
assertEquals(r1.hashCode(), r2.hashCode());
- r1 = new Resource(UUID.randomUUID(), UUID.randomUUID(), "equalsTest", "1.1.1",
+ r1 = new Resource(UUID.randomUUID(), UUID.randomUUID(), EQUALS_TEST, VERSION_111,
ResourceType.VFC);
r2 = new Resource(r1);
assertEquals(r1.hashCode(), r2.hashCode());
diff --git a/models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ServiceInstanceTest.java b/models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ServiceInstanceTest.java
index ca2cb3d0e..c06974cd5 100644
--- a/models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ServiceInstanceTest.java
+++ b/models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ServiceInstanceTest.java
@@ -30,6 +30,10 @@ import org.junit.Test;
public class ServiceInstanceTest {
+ private static final String SERVICE = "service";
+ private static final String INSTANCE = "instance";
+ private static final String VERSION_333 = "3.3.3";
+
@Test
public void testConstructors() {
ServiceInstance si = new ServiceInstance();
@@ -123,13 +127,13 @@ public class ServiceInstanceTest {
assertTrue(si1.equals(si2));
assertTrue(si2.equals(si1));
- si1.setServiceInstanceName("instance");
- si1.setServiceName("service");
+ si1.setServiceInstanceName(INSTANCE);
+ si1.setServiceName(SERVICE);
si1.setServiceInstanceUUID(UUID.randomUUID());
si1.setServiceUUID(UUID.randomUUID());
si1.setPersonaModelUUID(UUID.randomUUID());
si1.setWidgetModelUUID(UUID.randomUUID());
- si1.setWidgetModelVersion("3.3.3");
+ si1.setWidgetModelVersion(VERSION_333);
si2 = new ServiceInstance(si1);
assertTrue(si1.equals(si2));
assertTrue(si2.equals(si1));
@@ -141,13 +145,13 @@ public class ServiceInstanceTest {
ServiceInstance si2 = new ServiceInstance(si1);
assertEquals(si1.toString(), si2.toString());
- si1.setServiceInstanceName("instance");
- si1.setServiceName("service");
+ si1.setServiceInstanceName(INSTANCE);
+ si1.setServiceName(SERVICE);
si1.setServiceInstanceUUID(UUID.randomUUID());
si1.setServiceUUID(UUID.randomUUID());
si1.setPersonaModelUUID(UUID.randomUUID());
si1.setWidgetModelUUID(UUID.randomUUID());
- si1.setWidgetModelVersion("3.3.3");
+ si1.setWidgetModelVersion(VERSION_333);
si2 = new ServiceInstance(si1);
assertEquals(si1.toString(), si2.toString());
}
@@ -158,13 +162,13 @@ public class ServiceInstanceTest {
ServiceInstance si2 = new ServiceInstance(si1);
assertEquals(si1.hashCode(), si2.hashCode());
- si1.setServiceInstanceName("instance");
- si1.setServiceName("service");
+ si1.setServiceInstanceName(INSTANCE);
+ si1.setServiceName(SERVICE);
si1.setServiceInstanceUUID(UUID.randomUUID());
si1.setServiceUUID(UUID.randomUUID());
si1.setPersonaModelUUID(UUID.randomUUID());
si1.setWidgetModelUUID(UUID.randomUUID());
- si1.setWidgetModelVersion("3.3.3");
+ si1.setWidgetModelVersion(VERSION_333);
si2 = new ServiceInstance(si1);
assertEquals(si1.hashCode(), si2.hashCode());
}
diff --git a/models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ServiceTest.java b/models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ServiceTest.java
index 3bf6a537e..19238622d 100644
--- a/models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ServiceTest.java
+++ b/models-interactions/model-impl/sdc/src/test/java/org/onap/policy/sdc/ServiceTest.java
@@ -30,6 +30,9 @@ import org.junit.Test;
public class ServiceTest {
+ private static final String EQUALS_TEST = "equalsTest";
+ private static final String VERSION_111 = "1.1.1";
+
@Test
public void testConstructors() {
Service svc = new Service();
@@ -108,7 +111,7 @@ public class ServiceTest {
assertTrue(s1.equals(s2));
assertTrue(s2.equals(s1));
- s1 = new Service(UUID.randomUUID(), UUID.randomUUID(), "equalsTest", "1.1.1");
+ s1 = new Service(UUID.randomUUID(), UUID.randomUUID(), EQUALS_TEST, VERSION_111);
s2 = new Service(s1);
assertTrue(s1.equals(s2));
assertTrue(s2.equals(s1));
@@ -120,7 +123,7 @@ public class ServiceTest {
Service s2 = new Service(s1);
assertEquals(s1.toString(), s2.toString());
- s1 = new Service(UUID.randomUUID(), UUID.randomUUID(), "equalsTest", "1.1.1");
+ s1 = new Service(UUID.randomUUID(), UUID.randomUUID(), EQUALS_TEST, VERSION_111);
s2 = new Service(s1);
assertEquals(s1.toString(), s2.toString());
}
@@ -131,7 +134,7 @@ public class ServiceTest {
Service s2 = new Service(s1);
assertEquals(s1.hashCode(), s2.hashCode());
- s1 = new Service(UUID.randomUUID(), UUID.randomUUID(), "equalsTest", "1.1.1");
+ s1 = new Service(UUID.randomUUID(), UUID.randomUUID(), EQUALS_TEST, VERSION_111);
s2 = new Service(s1);
assertEquals(s1.hashCode(), s2.hashCode());
}