diff options
author | liamfallon <liam.fallon@est.tech> | 2020-03-12 12:15:04 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@est.tech> | 2020-03-12 16:48:55 +0000 |
commit | 658d2377a96284739b283b855b80dd80196dc91f (patch) | |
tree | 6ec5674c0d98fe36bc76a2f5f7099130cb496b02 /models-interactions/model-impl/sdc/src/test | |
parent | c2e24def7c1de97838af00560bdb0bf84f3abc4b (diff) |
Clean up minor checkstyle/sonar issues
A few minor eclipse warnings and checkstyle warnings in policy models.
Issue-ID: POLICY-1910
Change-Id: I612c6514fa7d88cb8658a7ee1618869a525e48d7
Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'models-interactions/model-impl/sdc/src/test')
3 files changed, 66 insertions, 63 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 8ae0084f6..e1068cb31 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 @@ -3,7 +3,7 @@ * sdc * ================================================================================ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ public class ResourceInstanceTest { ResourceInstance ri = new ResourceInstance(); assertEquals(null, ri.getResourceInstanceName()); assertEquals(null, ri.getResourceUuid()); - assertEquals(null, ri.getResourceInvariantUUID()); + assertEquals(null, ri.getResourceInvariantUuid()); assertEquals(null, ri.getResourceName()); assertEquals(null, ri.getResourceType()); assertEquals(null, ri.getResourceVersion()); @@ -47,7 +47,7 @@ public class ResourceInstanceTest { ResourceInstance ri2 = new ResourceInstance((ResourceInstance) null); assertEquals(null, ri2.getResourceInstanceName()); assertEquals(null, ri2.getResourceUuid()); - assertEquals(null, ri2.getResourceInvariantUUID()); + assertEquals(null, ri2.getResourceInvariantUuid()); assertEquals(null, ri2.getResourceName()); assertEquals(null, ri2.getResourceType()); assertEquals(null, ri2.getResourceVersion()); @@ -55,7 +55,7 @@ public class ResourceInstanceTest { ri2 = new ResourceInstance(ri); assertEquals(ri2.getResourceInstanceName(), ri.getResourceInstanceName()); assertEquals(ri2.getResourceUuid(), ri.getResourceUuid()); - assertEquals(ri2.getResourceInvariantUUID(), ri.getResourceInvariantUUID()); + assertEquals(ri2.getResourceInvariantUuid(), ri.getResourceInvariantUuid()); assertEquals(ri2.getResourceName(), ri.getResourceName()); assertEquals(ri2.getResourceType(), ri.getResourceType()); assertEquals(ri2.getResourceVersion(), ri.getResourceVersion()); @@ -65,7 +65,8 @@ public class ResourceInstanceTest { public void testInstanceName() { ResourceInstance ri = new ResourceInstance(); String name = "nameTestInstance"; - ri.setResourceInstanceName(name);; + ri.setResourceInstanceName(name); + ; assertEquals(name, ri.getResourceInstanceName()); } @@ -81,8 +82,8 @@ public class ResourceInstanceTest { public void testInvariantUuid() { ResourceInstance ri = new ResourceInstance(); UUID uuid = UUID.randomUUID(); - ri.setResourceInvariantUUID(uuid); - assertEquals(uuid, ri.getResourceInvariantUUID()); + ri.setResourceInvariantUuid(uuid); + assertEquals(uuid, ri.getResourceInvariantUuid()); } @Test @@ -117,8 +118,8 @@ public class ResourceInstanceTest { ri1.setResourceInstanceName(INSTANCE); ri1.setResourceName(RESOURCE); - ri1.setResourceInvariantUUID(UUID.randomUUID()); - ri1.setResourceInvariantUUID(UUID.randomUUID()); + ri1.setResourceInvariantUuid(UUID.randomUUID()); + ri1.setResourceInvariantUuid(UUID.randomUUID()); ri1.setResourceVersion(VERSION_000); ri1.setResourceType(ResourceType.VL); ri2 = new ResourceInstance(ri1); @@ -134,8 +135,8 @@ public class ResourceInstanceTest { ri1.setResourceInstanceName(INSTANCE); ri1.setResourceName(RESOURCE); - ri1.setResourceInvariantUUID(UUID.randomUUID()); - ri1.setResourceInvariantUUID(UUID.randomUUID()); + ri1.setResourceInvariantUuid(UUID.randomUUID()); + ri1.setResourceInvariantUuid(UUID.randomUUID()); ri1.setResourceVersion(VERSION_000); ri1.setResourceType(ResourceType.VL); ri2 = new ResourceInstance(ri1); @@ -150,8 +151,8 @@ public class ResourceInstanceTest { ri1.setResourceInstanceName(INSTANCE); ri1.setResourceName(RESOURCE); - ri1.setResourceInvariantUUID(UUID.randomUUID()); - ri1.setResourceInvariantUUID(UUID.randomUUID()); + ri1.setResourceInvariantUuid(UUID.randomUUID()); + ri1.setResourceInvariantUuid(UUID.randomUUID()); ri1.setResourceVersion(VERSION_000); ri1.setResourceType(ResourceType.VL); ri2 = new ResourceInstance(ri1); 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 c06974cd5..c81a12fc5 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 @@ -3,7 +3,7 @@ * sdc * ================================================================================ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,29 +38,29 @@ public class ServiceInstanceTest { public void testConstructors() { ServiceInstance si = new ServiceInstance(); assertEquals(null, si.getServiceInstanceName()); - assertEquals(null, si.getServiceUUID()); - assertEquals(null, si.getServiceInstanceUUID()); + assertEquals(null, si.getServiceUuid()); + assertEquals(null, si.getServiceInstanceUuid()); assertEquals(null, si.getServiceName()); - assertEquals(null, si.getPersonaModelUUID()); - assertEquals(null, si.getWidgetModelUUID()); + assertEquals(null, si.getPersonaModelUuid()); + assertEquals(null, si.getWidgetModelUuid()); assertEquals(null, si.getWidgetModelVersion()); ServiceInstance si2 = new ServiceInstance((ServiceInstance) null); assertEquals(null, si2.getServiceInstanceName()); - assertEquals(null, si2.getServiceUUID()); - assertEquals(null, si2.getServiceInstanceUUID()); + assertEquals(null, si2.getServiceUuid()); + assertEquals(null, si2.getServiceInstanceUuid()); assertEquals(null, si2.getServiceName()); - assertEquals(null, si2.getPersonaModelUUID()); - assertEquals(null, si2.getWidgetModelUUID()); + assertEquals(null, si2.getPersonaModelUuid()); + assertEquals(null, si2.getWidgetModelUuid()); assertEquals(null, si2.getWidgetModelVersion()); si2 = new ServiceInstance(si); assertEquals(si2.getServiceInstanceName(), si.getServiceInstanceName()); - assertEquals(si2.getServiceUUID(), si.getServiceUUID()); - assertEquals(si2.getServiceInstanceUUID(), si.getServiceInstanceUUID()); + assertEquals(si2.getServiceUuid(), si.getServiceUuid()); + assertEquals(si2.getServiceInstanceUuid(), si.getServiceInstanceUuid()); assertEquals(si2.getServiceName(), si.getServiceName()); - assertEquals(si2.getPersonaModelUUID(), si.getPersonaModelUUID()); - assertEquals(si2.getWidgetModelUUID(), si.getWidgetModelUUID()); + assertEquals(si2.getPersonaModelUuid(), si.getPersonaModelUuid()); + assertEquals(si2.getWidgetModelUuid(), si.getWidgetModelUuid()); assertEquals(si2.getWidgetModelVersion(), si.getWidgetModelVersion()); } @@ -68,7 +68,8 @@ public class ServiceInstanceTest { public void testInstanceName() { ServiceInstance si = new ServiceInstance(); String name = "nameTestInstance"; - si.setServiceInstanceName(name);; + si.setServiceInstanceName(name); + ; assertEquals(name, si.getServiceInstanceName()); } @@ -76,16 +77,16 @@ public class ServiceInstanceTest { public void testUuid() { ServiceInstance si = new ServiceInstance(); UUID uuid = UUID.randomUUID(); - si.setServiceUUID(uuid); - assertEquals(uuid, si.getServiceUUID()); + si.setServiceUuid(uuid); + assertEquals(uuid, si.getServiceUuid()); } @Test public void testInstanceUuid() { ServiceInstance si = new ServiceInstance(); UUID uuid = UUID.randomUUID(); - si.setServiceInstanceUUID(uuid); - assertEquals(uuid, si.getServiceInstanceUUID()); + si.setServiceInstanceUuid(uuid); + assertEquals(uuid, si.getServiceInstanceUuid()); } @Test @@ -100,23 +101,24 @@ public class ServiceInstanceTest { public void testPersonaModelUuid() { ServiceInstance si = new ServiceInstance(); UUID uuid = UUID.randomUUID(); - si.setPersonaModelUUID(uuid); - assertEquals(uuid, si.getPersonaModelUUID()); + si.setPersonaModelUuid(uuid); + assertEquals(uuid, si.getPersonaModelUuid()); } @Test public void testWidgetModelUuid() { ServiceInstance si = new ServiceInstance(); UUID uuid = UUID.randomUUID(); - si.setWidgetModelUUID(uuid); - assertEquals(uuid, si.getWidgetModelUUID()); + si.setWidgetModelUuid(uuid); + assertEquals(uuid, si.getWidgetModelUuid()); } @Test public void testWidgetModelVersion() { ServiceInstance si = new ServiceInstance(); String version = "2.2.2"; - si.setWidgetModelVersion(version);; + si.setWidgetModelVersion(version); + ; assertEquals(version, si.getWidgetModelVersion()); } @@ -129,10 +131,10 @@ public class ServiceInstanceTest { si1.setServiceInstanceName(INSTANCE); si1.setServiceName(SERVICE); - si1.setServiceInstanceUUID(UUID.randomUUID()); - si1.setServiceUUID(UUID.randomUUID()); - si1.setPersonaModelUUID(UUID.randomUUID()); - si1.setWidgetModelUUID(UUID.randomUUID()); + si1.setServiceInstanceUuid(UUID.randomUUID()); + si1.setServiceUuid(UUID.randomUUID()); + si1.setPersonaModelUuid(UUID.randomUUID()); + si1.setWidgetModelUuid(UUID.randomUUID()); si1.setWidgetModelVersion(VERSION_333); si2 = new ServiceInstance(si1); assertTrue(si1.equals(si2)); @@ -147,10 +149,10 @@ public class ServiceInstanceTest { si1.setServiceInstanceName(INSTANCE); si1.setServiceName(SERVICE); - si1.setServiceInstanceUUID(UUID.randomUUID()); - si1.setServiceUUID(UUID.randomUUID()); - si1.setPersonaModelUUID(UUID.randomUUID()); - si1.setWidgetModelUUID(UUID.randomUUID()); + si1.setServiceInstanceUuid(UUID.randomUUID()); + si1.setServiceUuid(UUID.randomUUID()); + si1.setPersonaModelUuid(UUID.randomUUID()); + si1.setWidgetModelUuid(UUID.randomUUID()); si1.setWidgetModelVersion(VERSION_333); si2 = new ServiceInstance(si1); assertEquals(si1.toString(), si2.toString()); @@ -164,10 +166,10 @@ public class ServiceInstanceTest { si1.setServiceInstanceName(INSTANCE); si1.setServiceName(SERVICE); - si1.setServiceInstanceUUID(UUID.randomUUID()); - si1.setServiceUUID(UUID.randomUUID()); - si1.setPersonaModelUUID(UUID.randomUUID()); - si1.setWidgetModelUUID(UUID.randomUUID()); + si1.setServiceInstanceUuid(UUID.randomUUID()); + si1.setServiceUuid(UUID.randomUUID()); + si1.setPersonaModelUuid(UUID.randomUUID()); + si1.setWidgetModelUuid(UUID.randomUUID()); 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 19238622d..dc5d9d3b2 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 @@ -3,7 +3,7 @@ * sdc * ================================================================================ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,23 +36,23 @@ public class ServiceTest { @Test public void testConstructors() { Service svc = new Service(); - assertEquals(null, svc.getServiceUUID()); - assertEquals(null, svc.getServiceInvariantUUID()); + assertEquals(null, svc.getServiceUuid()); + assertEquals(null, svc.getServiceInvariantUuid()); assertEquals(null, svc.getServiceName()); assertEquals(null, svc.getServiceVersion()); UUID uuid = UUID.randomUUID(); svc = new Service(uuid); - assertEquals(uuid, svc.getServiceUUID()); - assertEquals(null, svc.getServiceInvariantUUID()); + assertEquals(uuid, svc.getServiceUuid()); + assertEquals(null, svc.getServiceInvariantUuid()); assertEquals(null, svc.getServiceName()); assertEquals(null, svc.getServiceVersion()); String name = "constTest"; svc = new Service(name); - assertEquals(null, svc.getServiceUUID()); + assertEquals(null, svc.getServiceUuid()); assertEquals(name, svc.getServiceName()); - assertEquals(null, svc.getServiceInvariantUUID()); + assertEquals(null, svc.getServiceInvariantUuid()); assertEquals(null, svc.getServiceVersion()); uuid = UUID.randomUUID(); @@ -60,14 +60,14 @@ public class ServiceTest { name = "constTestUUID"; String version = "0.0.1"; svc = new Service(uuid, uuidInvariant, name, version); - assertEquals(uuid, svc.getServiceUUID()); - assertEquals(uuidInvariant, svc.getServiceInvariantUUID()); + assertEquals(uuid, svc.getServiceUuid()); + assertEquals(uuidInvariant, svc.getServiceInvariantUuid()); assertEquals(name, svc.getServiceName()); assertEquals(version, svc.getServiceVersion()); Service s2 = new Service(svc); - assertEquals(uuid, s2.getServiceUUID()); - assertEquals(uuidInvariant, s2.getServiceInvariantUUID()); + assertEquals(uuid, s2.getServiceUuid()); + assertEquals(uuidInvariant, s2.getServiceInvariantUuid()); assertEquals(name, s2.getServiceName()); assertEquals(version, s2.getServiceVersion()); } @@ -76,16 +76,16 @@ public class ServiceTest { public void testUuid() { Service svc = new Service(); UUID uuid = UUID.randomUUID(); - svc.setServiceUUID(uuid); - assertEquals(uuid, svc.getServiceUUID()); + svc.setServiceUuid(uuid); + assertEquals(uuid, svc.getServiceUuid()); } @Test public void testInvariantUuid() { Service svc = new Service(); UUID uuid = UUID.randomUUID(); - svc.setServiceInvariantUUID(uuid); - assertEquals(uuid, svc.getServiceInvariantUUID()); + svc.setServiceInvariantUuid(uuid); + assertEquals(uuid, svc.getServiceInvariantUuid()); } @Test |