diff options
Diffstat (limited to 'models-interactions/model-impl/sdc')
7 files changed, 131 insertions, 402 deletions
diff --git a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Resource.java b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Resource.java index 61b6e3afd..d5e8b6c2a 100644 --- a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Resource.java +++ b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Resource.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. @@ -23,23 +23,22 @@ package org.onap.policy.sdc; import java.io.Serializable; import java.util.UUID; -import lombok.Getter; -import lombok.Setter; -@Getter -@Setter +import lombok.Data; + +@Data public class Resource implements Serializable { private static final long serialVersionUID = -913729158733348027L; - private UUID resourceUuid; - private UUID resourceInvariantUuid; - private String resourceName; - private String resourceVersion; - private String resourceType; + private UUID resourceUuid; + private UUID resourceInvariantUuid; + private String resourceName; + private String resourceVersion; + private String resourceType; public Resource() { - //Empty Constructor + // Empty Constructor } /** @@ -80,74 +79,4 @@ public class Resource implements Serializable { this.resourceVersion = version; this.resourceType = type; } - - @Override - public String toString() { - return "Resource [resourceUuid=" + resourceUuid + ", resourceInvariantUuid=" + resourceInvariantUuid - + ", resourceName=" + resourceName + ", resourceVersion=" + resourceVersion + ", resourceType=" - + resourceType + "]"; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((resourceInvariantUuid == null) ? 0 : resourceInvariantUuid.hashCode()); - result = prime * result + ((resourceName == null) ? 0 : resourceName.hashCode()); - result = prime * result + ((resourceType == null) ? 0 : resourceType.hashCode()); - result = prime * result + ((resourceUuid == null) ? 0 : resourceUuid.hashCode()); - result = prime * result + ((resourceVersion == null) ? 0 : resourceVersion.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - Resource other = (Resource) obj; - if (resourceInvariantUuid == null) { - if (other.resourceInvariantUuid != null) { - return false; - } - } else if (!resourceInvariantUuid.equals(other.resourceInvariantUuid)) { - return false; - } - if (resourceName == null) { - if (other.resourceName != null) { - return false; - } - } else if (!resourceName.equals(other.resourceName)) { - return false; - } - if (resourceType == null) { - if (other.resourceType != null) { - return false; - } - } else if (!resourceType.equals(other.resourceType)) { - return false; - } - if (resourceUuid == null) { - if (other.resourceUuid != null) { - return false; - } - } else if (!resourceUuid.equals(other.resourceUuid)) { - return false; - } - if (resourceVersion == null) { - if (other.resourceVersion != null) { - return false; - } - } else if (!resourceVersion.equals(other.resourceVersion)) { - return false; - } - return true; - } - } diff --git a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ResourceInstance.java b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ResourceInstance.java index 05842e24c..0b6068dce 100644 --- a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ResourceInstance.java +++ b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ResourceInstance.java @@ -21,26 +21,31 @@ package org.onap.policy.sdc; +import com.google.gson.annotations.SerializedName; + import java.io.Serializable; import java.util.UUID; -import lombok.Getter; -import lombok.Setter; -@Getter -@Setter +import lombok.Data; + +@Data public class ResourceInstance implements Serializable { private static final long serialVersionUID = -5506162340393802424L; + @SerializedName("ResourceUUID") + private UUID resourceUuid; + private String resourceInstanceName; private String resourceName; - private UUID resourceInvariantUuid; private String resourceVersion; private String resourceType; - private UUID resourceUuid; + + @SerializedName("ResourceInvariantUUID") + private UUID resourceInvariantUuid; public ResourceInstance() { - //Empty Constructor + // Empty Constructor } /** @@ -59,86 +64,4 @@ public class ResourceInstance implements Serializable { this.resourceType = instance.resourceType; this.resourceUuid = instance.resourceUuid; } - - public UUID getResourceInvariantUUID() { - return resourceInvariantUuid; - } - - public void setResourceInvariantUUID(UUID resourceInvariantUuid) { - this.resourceInvariantUuid = resourceInvariantUuid; - } - - @Override - public String toString() { - return "ResourceInstance [resourceInstanceName=" + resourceInstanceName + ", resourceName=" + resourceName - + ", resourceInvariantUuid=" + resourceInvariantUuid + ", resourceVersion=" + resourceVersion - + ", resourceType=" + resourceType + ", resourceUuid=" + resourceUuid + "]"; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((resourceInstanceName == null) ? 0 : resourceInstanceName.hashCode()); - result = prime * result + ((resourceInvariantUuid == null) ? 0 : resourceInvariantUuid.hashCode()); - result = prime * result + ((resourceName == null) ? 0 : resourceName.hashCode()); - result = prime * result + ((resourceType == null) ? 0 : resourceType.hashCode()); - result = prime * result + ((resourceUuid == null) ? 0 : resourceUuid.hashCode()); - result = prime * result + ((resourceVersion == null) ? 0 : resourceVersion.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - ResourceInstance other = (ResourceInstance) obj; - if (resourceInstanceName == null) { - if (other.resourceInstanceName != null) { - return false; - } - } else if (!resourceInstanceName.equals(other.resourceInstanceName)) { - return false; - } - if (resourceInvariantUuid == null) { - if (other.resourceInvariantUuid != null) { - return false; - } - } else if (!resourceInvariantUuid.equals(other.resourceInvariantUuid)) { - return false; - } - if (resourceName == null) { - if (other.resourceName != null) { - return false; - } - } else if (!resourceName.equals(other.resourceName)) { - return false; - } - if (resourceType != other.resourceType) { - return false; - } - if (resourceUuid == null) { - if (other.resourceUuid != null) { - return false; - } - } else if (!resourceUuid.equals(other.resourceUuid)) { - return false; - } - if (resourceVersion == null) { - if (other.resourceVersion != null) { - return false; - } - } else if (!resourceVersion.equals(other.resourceVersion)) { - return false; - } - return true; - } - } diff --git a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Service.java b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Service.java index 7ab2f9322..765eeec54 100644 --- a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Service.java +++ b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Service.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. @@ -21,28 +21,33 @@ package org.onap.policy.sdc; +import com.google.gson.annotations.SerializedName; + import java.io.Serializable; import java.util.UUID; -import lombok.Getter; -import lombok.Setter; -@Getter -@Setter +import lombok.Data; + +@Data public class Service implements Serializable { private static final long serialVersionUID = -1249276698549996806L; - private UUID serviceUUID; - private UUID serviceInvariantUUID; + @SerializedName("serviceUuid") + private UUID serviceUuid; + + @SerializedName("serviceInvariantUuid") + private UUID serviceInvariantUuid; + private String serviceName; private String serviceVersion; public Service() { - //Empty Constructor + // Empty Constructor } public Service(UUID uuid) { - this.serviceUUID = uuid; + this.serviceUuid = uuid; } public Service(String name) { @@ -53,13 +58,13 @@ public class Service implements Serializable { * Constructor. * * @param uuid service id - * @param invariantUUID service invariant id + * @param invariantUuid service invariant id * @param name name * @param version version */ - public Service(UUID uuid, UUID invariantUUID, String name, String version) { - this.serviceUUID = uuid; - this.serviceInvariantUUID = invariantUUID; + public Service(UUID uuid, UUID invariantUuid, String name, String version) { + this.serviceUuid = uuid; + this.serviceInvariantUuid = invariantUuid; this.serviceName = name; this.serviceVersion = version; } @@ -70,66 +75,9 @@ public class Service implements Serializable { * @param service copy object */ public Service(Service service) { - this.serviceUUID = service.serviceUUID; - this.serviceInvariantUUID = service.serviceInvariantUUID; + this.serviceUuid = service.serviceUuid; + this.serviceInvariantUuid = service.serviceInvariantUuid; this.serviceName = service.serviceName; this.serviceVersion = service.serviceVersion; } - - @Override - public String toString() { - return "Service [serviceUUID=" + serviceUUID + ", serviceInvariantUUID=" + serviceInvariantUUID - + ", serviceName=" + serviceName + ", serviceVersion=" + serviceVersion + "]"; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((serviceInvariantUUID == null) ? 0 : serviceInvariantUUID.hashCode()); - result = prime * result + ((serviceName == null) ? 0 : serviceName.hashCode()); - result = prime * result + ((serviceUUID == null) ? 0 : serviceUUID.hashCode()); - result = prime * result + ((serviceVersion == null) ? 0 : serviceVersion.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - Service other = (Service) obj; - if (serviceInvariantUUID == null) { - if (other.serviceInvariantUUID != null) { - return false; - } - } else if (!serviceInvariantUUID.equals(other.serviceInvariantUUID)) { - return false; - } - if (serviceName == null) { - if (other.serviceName != null) { - return false; - } - } else if (!serviceName.equals(other.serviceName)) { - return false; - } - if (serviceUUID == null) { - if (other.serviceUUID != null) { - return false; - } - } else if (!serviceUUID.equals(other.serviceUUID)) { - return false; - } - if (serviceVersion == null) { - return other.serviceVersion == null; - } else { - return serviceVersion.equals(other.serviceVersion); - } - } } diff --git a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ServiceInstance.java b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ServiceInstance.java index e02952219..45e1dc56a 100644 --- a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ServiceInstance.java +++ b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ServiceInstance.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. @@ -21,27 +21,36 @@ package org.onap.policy.sdc; +import com.google.gson.annotations.SerializedName; + import java.io.Serializable; import java.util.UUID; -import lombok.Getter; -import lombok.Setter; -@Getter -@Setter +import lombok.Data; + +@Data public class ServiceInstance implements Serializable { private static final long serialVersionUID = 6285260780966679625L; - private UUID personaModelUUID; - private UUID serviceUUID; - private UUID serviceInstanceUUID; - private UUID widgetModelUUID; + @SerializedName("personaModelUUID") + private UUID personaModelUuid; + + @SerializedName("serviceUUID") + private UUID serviceUuid; + + @SerializedName("serviceInstanceUUID") + private UUID serviceInstanceUuid; + + @SerializedName("widgetModelUUID") + private UUID widgetModelUuid; + private String widgetModelVersion; private String serviceName; private String serviceInstanceName; public ServiceInstance() { - //Empty Constructor + // Empty Constructor } /** @@ -53,95 +62,12 @@ public class ServiceInstance implements Serializable { if (instance == null) { return; } - this.personaModelUUID = instance.personaModelUUID; - this.serviceUUID = instance.serviceUUID; - this.serviceInstanceUUID = instance.serviceInstanceUUID; - this.widgetModelUUID = instance.widgetModelUUID; + this.personaModelUuid = instance.personaModelUuid; + this.serviceUuid = instance.serviceUuid; + this.serviceInstanceUuid = instance.serviceInstanceUuid; + this.widgetModelUuid = instance.widgetModelUuid; this.widgetModelVersion = instance.widgetModelVersion; this.serviceName = instance.serviceName; this.serviceInstanceName = instance.serviceInstanceName; } - - @Override - public String toString() { - return "ServiceInstance [personaModelUUID=" + personaModelUUID + ", serviceUUID=" + serviceUUID - + ", serviceInstanceUUID=" + serviceInstanceUUID + ", widgetModelUUID=" + widgetModelUUID - + ", widgetModelVersion=" + widgetModelVersion + ", serviceName=" + serviceName - + ", serviceInstanceName=" + serviceInstanceName + "]"; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((personaModelUUID == null) ? 0 : personaModelUUID.hashCode()); - result = prime * result + ((serviceInstanceName == null) ? 0 : serviceInstanceName.hashCode()); - result = prime * result + ((serviceInstanceUUID == null) ? 0 : serviceInstanceUUID.hashCode()); - result = prime * result + ((serviceName == null) ? 0 : serviceName.hashCode()); - result = prime * result + ((serviceUUID == null) ? 0 : serviceUUID.hashCode()); - result = prime * result + ((widgetModelUUID == null) ? 0 : widgetModelUUID.hashCode()); - result = prime * result + ((widgetModelVersion == null) ? 0 : widgetModelVersion.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - ServiceInstance other = (ServiceInstance) obj; - if (personaModelUUID == null) { - if (other.personaModelUUID != null) { - return false; - } - } else if (!personaModelUUID.equals(other.personaModelUUID)) { - return false; - } - if (serviceInstanceName == null) { - if (other.serviceInstanceName != null) { - return false; - } - } else if (!serviceInstanceName.equals(other.serviceInstanceName)) { - return false; - } - if (serviceInstanceUUID == null) { - if (other.serviceInstanceUUID != null) { - return false; - } - } else if (!serviceInstanceUUID.equals(other.serviceInstanceUUID)) { - return false; - } - if (serviceName == null) { - if (other.serviceName != null) { - return false; - } - } else if (!serviceName.equals(other.serviceName)) { - return false; - } - if (serviceUUID == null) { - if (other.serviceUUID != null) { - return false; - } - } else if (!serviceUUID.equals(other.serviceUUID)) { - return false; - } - if (widgetModelUUID == null) { - if (other.widgetModelUUID != null) { - return false; - } - } else if (!widgetModelUUID.equals(other.widgetModelUUID)) { - return false; - } - if (widgetModelVersion == null) { - return other.widgetModelVersion == null; - } else { - return widgetModelVersion.equals(other.widgetModelVersion); - } - } } 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 |