From 2e42e9f006091924ee8a43ec577f23bb97f2d37e Mon Sep 17 00:00:00 2001 From: "Tait,Trevor(rt0435)" Date: Wed, 5 Sep 2018 15:56:02 -0400 Subject: Update API from Demo feedback Issue-ID: LOG-643 Change-Id: I226075fa4b0f5fb6f8fadca34e0ce864d4c0684b Signed-off-by: Tait,Trevor(rt0435) --- .../java/org/onap/pomba/common/datatypes/Attribute.java | 5 +++-- .../java/org/onap/pomba/common/datatypes/ModelContext.java | 2 +- src/main/java/org/onap/pomba/common/datatypes/Network.java | 14 +++++++------- src/main/java/org/onap/pomba/common/datatypes/Service.java | 2 +- src/main/java/org/onap/pomba/common/datatypes/VF.java | 11 +---------- .../java/org/onap/pomba/common/datatypes/VFModule.java | 11 +---------- src/main/java/org/onap/pomba/common/datatypes/VM.java | 2 +- src/main/java/org/onap/pomba/common/datatypes/VNFC.java | 14 +++++++------- .../java/org/onap/pomba/common/datatypes/NetworkTests.java | 4 ++-- .../org/onap/pomba/common/datatypes/VfModuleTests.java | 2 -- src/test/java/org/onap/pomba/common/datatypes/VfTests.java | 2 -- .../java/org/onap/pomba/common/datatypes/VnfcTests.java | 4 ++-- 12 files changed, 26 insertions(+), 47 deletions(-) diff --git a/src/main/java/org/onap/pomba/common/datatypes/Attribute.java b/src/main/java/org/onap/pomba/common/datatypes/Attribute.java index 6a1f7b3..1bf32bc 100644 --- a/src/main/java/org/onap/pomba/common/datatypes/Attribute.java +++ b/src/main/java/org/onap/pomba/common/datatypes/Attribute.java @@ -30,7 +30,7 @@ public class Attribute { private String value; @Expose @SerializedName("dataQuality") - private DataQuality dataQuality = new DataQuality(); + private DataQuality dataQuality = DataQuality.ok(); public enum Name { adminState, @@ -43,7 +43,8 @@ public class Attribute { physicalNetworkName, sharedNetworkBoolean, networkRole, - routerExternalBoolean + routerExternalBoolean, + imageId } public Name getName() { return name; diff --git a/src/main/java/org/onap/pomba/common/datatypes/ModelContext.java b/src/main/java/org/onap/pomba/common/datatypes/ModelContext.java index 592d68a..1fc8118 100644 --- a/src/main/java/org/onap/pomba/common/datatypes/ModelContext.java +++ b/src/main/java/org/onap/pomba/common/datatypes/ModelContext.java @@ -30,7 +30,7 @@ public class ModelContext { private Service service; @Expose @SerializedName("dataQuality") - private DataQuality dataQuality = new DataQuality(); + private DataQuality dataQuality = DataQuality.ok(); @Expose @SerializedName("attributeList") private List attributeList = new ArrayList<>(); diff --git a/src/main/java/org/onap/pomba/common/datatypes/Network.java b/src/main/java/org/onap/pomba/common/datatypes/Network.java index 19c286c..171c6a5 100644 --- a/src/main/java/org/onap/pomba/common/datatypes/Network.java +++ b/src/main/java/org/onap/pomba/common/datatypes/Network.java @@ -34,11 +34,11 @@ public class Network { @SerializedName("uuid") private String uuid; @Expose - @SerializedName("nfNamingCode") - private String nfcNamingCode; + @SerializedName("type") + private String type; @Expose @SerializedName("dataQuality") - private DataQuality dataQuality = new DataQuality(); + private DataQuality dataQuality = DataQuality.ok(); @Expose @SerializedName("attributeList") private List attributeList = new ArrayList<>(); @@ -61,11 +61,11 @@ public class Network { public void setUuid(String uuid) { this.uuid = uuid; } - public String getNfcNamingCode() { - return nfcNamingCode; + public String getType() { + return type; } - public void setNfcNamingCode(String nfcType) { - this.nfcNamingCode = nfcType; + public void setType(String type) { + this.type = type; } public List getAttributes() { return attributeList; diff --git a/src/main/java/org/onap/pomba/common/datatypes/Service.java b/src/main/java/org/onap/pomba/common/datatypes/Service.java index b225b6a..1579434 100644 --- a/src/main/java/org/onap/pomba/common/datatypes/Service.java +++ b/src/main/java/org/onap/pomba/common/datatypes/Service.java @@ -36,7 +36,7 @@ public class Service { private String uuid; @Expose @SerializedName("dataQuality") - private DataQuality dataQuality = new DataQuality(); + private DataQuality dataQuality = DataQuality.ok(); @Expose @SerializedName("attributeList") private List attributeList = new ArrayList<>(); diff --git a/src/main/java/org/onap/pomba/common/datatypes/VF.java b/src/main/java/org/onap/pomba/common/datatypes/VF.java index 7bbb962..ded7ae2 100644 --- a/src/main/java/org/onap/pomba/common/datatypes/VF.java +++ b/src/main/java/org/onap/pomba/common/datatypes/VF.java @@ -39,11 +39,8 @@ public class VF { @SerializedName("uuid") private String uuid; @Expose - @SerializedName("nfNamingCode") - private String nfNamingCode; - @Expose @SerializedName("dataQuality") - private DataQuality dataQuality = new DataQuality(); + private DataQuality dataQuality = DataQuality.ok(); @Expose @SerializedName("attributeList") private List attributeList = new ArrayList<>(); @@ -78,12 +75,6 @@ public class VF { public void setUuid(String uuid) { this.uuid = uuid; } - public String getNfNamingCode() { - return nfNamingCode; - } - public void setNfNamingCode(String nfNamingCode) { - this.nfNamingCode = nfNamingCode; - } public List getVfModules() { return vfModules; } diff --git a/src/main/java/org/onap/pomba/common/datatypes/VFModule.java b/src/main/java/org/onap/pomba/common/datatypes/VFModule.java index 876f6b2..9d19dc0 100644 --- a/src/main/java/org/onap/pomba/common/datatypes/VFModule.java +++ b/src/main/java/org/onap/pomba/common/datatypes/VFModule.java @@ -35,9 +35,6 @@ public class VFModule { @SerializedName("uuid") private String uuid; @Expose - @SerializedName("nfNamingCode") - private String nfNamingCode; - @Expose @SerializedName("maxInstances") private int maxInstances; @Expose @@ -45,7 +42,7 @@ public class VFModule { private int minInstances; @Expose @SerializedName("dataQuality") - private DataQuality dataQuality = new DataQuality(); + private DataQuality dataQuality = DataQuality.ok(); @Expose @SerializedName("attributeList") private List attributeList = new ArrayList<>(); @@ -75,12 +72,6 @@ public class VFModule { public void setUuid(String uuid) { this.uuid = uuid; } - public String getNfNamingCode() { - return nfNamingCode; - } - public void setNfNamingCode(String nfNamingCode) { - this.nfNamingCode = nfNamingCode; - } public int getMaxInstances() { return maxInstances; } diff --git a/src/main/java/org/onap/pomba/common/datatypes/VM.java b/src/main/java/org/onap/pomba/common/datatypes/VM.java index 29f4c29..0b4be65 100644 --- a/src/main/java/org/onap/pomba/common/datatypes/VM.java +++ b/src/main/java/org/onap/pomba/common/datatypes/VM.java @@ -38,7 +38,7 @@ public class VM { private String nfcNamingCode; @Expose @SerializedName("dataQuality") - private DataQuality dataQuality = new DataQuality(); + private DataQuality dataQuality = DataQuality.ok(); @Expose @SerializedName("attributeList") private List attributeList = new ArrayList<>(); diff --git a/src/main/java/org/onap/pomba/common/datatypes/VNFC.java b/src/main/java/org/onap/pomba/common/datatypes/VNFC.java index 66c852a..dd697d8 100644 --- a/src/main/java/org/onap/pomba/common/datatypes/VNFC.java +++ b/src/main/java/org/onap/pomba/common/datatypes/VNFC.java @@ -35,11 +35,11 @@ public class VNFC { @SerializedName("uuid") private String uuid; @Expose - @SerializedName("nfNamingCode") - private String nfcNamingCode; + @SerializedName("type") + private String type; @Expose @SerializedName("dataQuality") - private DataQuality dataQuality = new DataQuality(); + private DataQuality dataQuality = DataQuality.ok(); @Expose @SerializedName("attributeList") private List attributeList = new ArrayList<>(); @@ -62,11 +62,11 @@ public class VNFC { public void setUuid(String uuid) { this.uuid = uuid; } - public String getNfcNamingCode() { - return nfcNamingCode; + public String getType() { + return type; } - public void setNfcNamingCode(String nfcType) { - this.nfcNamingCode = nfcType; + public void setType(String type) { + this.type = type; } public List getAttributes() { return attributeList; diff --git a/src/test/java/org/onap/pomba/common/datatypes/NetworkTests.java b/src/test/java/org/onap/pomba/common/datatypes/NetworkTests.java index 747bc7c..cfc6129 100644 --- a/src/test/java/org/onap/pomba/common/datatypes/NetworkTests.java +++ b/src/test/java/org/onap/pomba/common/datatypes/NetworkTests.java @@ -32,7 +32,7 @@ public class NetworkTests { aNetwork.setName("Network name"); aNetwork.setInvariantUuid("Invariant Uuid"); aNetwork.setUuid("Uuid"); - aNetwork.setNfcNamingCode("NFC Naming Code"); + aNetwork.setType("Type"); DataQuality dataQuality = new DataQuality(); dataQuality.setStatus(Status.error); dataQuality.setErrorText("Test"); @@ -42,8 +42,8 @@ public class NetworkTests { aNetwork.addAttribute(attribute); assertTrue("Network name doesn't match", aNetwork.getName().equals("Network name")); assertTrue("Network invariant uuid doesn't match", aNetwork.getInvariantUuid().equals("Invariant Uuid")); - assertTrue("Network NFC Naming Code doesn't match", aNetwork.getNfcNamingCode().equals("NFC Naming Code")); assertTrue("Network uuid doesn't match", aNetwork.getUuid().equals("Uuid")); + assertTrue("Network type doesn't match", aNetwork.getType().equals("Type")); assertTrue("Network data quality status doesn't match", aNetwork.getDataQuality().getStatus().equals(Status.error)); assertTrue("Network data quality error text doesn't match", aNetwork.getDataQuality().getErrorText().equals("Test")); assertTrue("Network attribute name doesn't match", aNetwork.getAttributes().get(0).getName().equals(Name.hostName)); diff --git a/src/test/java/org/onap/pomba/common/datatypes/VfModuleTests.java b/src/test/java/org/onap/pomba/common/datatypes/VfModuleTests.java index 3d46510..d4840d2 100644 --- a/src/test/java/org/onap/pomba/common/datatypes/VfModuleTests.java +++ b/src/test/java/org/onap/pomba/common/datatypes/VfModuleTests.java @@ -32,7 +32,6 @@ public class VfModuleTests { aVFModule.setName("Name"); aVFModule.setInvariantUuid("Invariant Uuid"); aVFModule.setUuid("Uuid"); - aVFModule.setNfNamingCode("Nf Naming Code"); aVFModule.setMaxInstances(10); aVFModule.setMinInstances(1); DataQuality dataQuality = new DataQuality(); @@ -45,7 +44,6 @@ public class VfModuleTests { assertTrue("VFModule Name doesn't match", aVFModule.getName().equals("Name")); assertTrue("VFModule Invariant Uuid doesn't match", aVFModule.getInvariantUuid().equals("Invariant Uuid")); assertTrue("VFModule Uuid doesn't match", aVFModule.getUuid().equals("Uuid")); - assertTrue("VFModule Nf Naming Code doesn't match", aVFModule.getNfNamingCode().equals("Nf Naming Code")); assertEquals(aVFModule.getMaxInstances(), 10); assertEquals(aVFModule.getMinInstances(), 1); assertTrue("VFModule data quality status doesn't match", aVFModule.getDataQuality().getStatus().equals(Status.error)); diff --git a/src/test/java/org/onap/pomba/common/datatypes/VfTests.java b/src/test/java/org/onap/pomba/common/datatypes/VfTests.java index 464758e..11978f7 100644 --- a/src/test/java/org/onap/pomba/common/datatypes/VfTests.java +++ b/src/test/java/org/onap/pomba/common/datatypes/VfTests.java @@ -36,7 +36,6 @@ public class VfTests { aVF.setType("Type"); aVF.setInvariantUuid("Invariant Uuid"); aVF.setUuid("Uuid"); - aVF.setNfNamingCode("NF Naming Code"); DataQuality dataQuality = new DataQuality(); dataQuality.setStatus(Status.error); dataQuality.setErrorText("Test"); @@ -48,7 +47,6 @@ public class VfTests { assertTrue("VF Type doesn't match", aVF.getType().equals("Type")); assertTrue("VF Invariant Uuid doesn't match", aVF.getInvariantUuid().equals("Invariant Uuid")); assertTrue("VF Uuid doesn't match", aVF.getUuid().equals("Uuid")); - assertTrue("VF NF Naming Code doesn't match", aVF.getNfNamingCode().equals("NF Naming Code")); assertTrue("VF data quality status doesn't match", aVF.getDataQuality().getStatus().equals(Status.error)); assertTrue("VF data quality error text doesn't match", aVF.getDataQuality().getErrorText().equals("Test")); assertTrue("VF attribute name doesn't match", aVF.getAttributes().get(0).getName().equals(Name.hostName)); diff --git a/src/test/java/org/onap/pomba/common/datatypes/VnfcTests.java b/src/test/java/org/onap/pomba/common/datatypes/VnfcTests.java index 38d68fe..628c646 100644 --- a/src/test/java/org/onap/pomba/common/datatypes/VnfcTests.java +++ b/src/test/java/org/onap/pomba/common/datatypes/VnfcTests.java @@ -32,7 +32,7 @@ public class VnfcTests { aVNFC.setName("VNFC name"); aVNFC.setInvariantUuid("Invariant Uuid"); aVNFC.setUuid("Uuid"); - aVNFC.setNfcNamingCode("NFC Naming Code"); + aVNFC.setType("Type"); DataQuality dataQuality = new DataQuality(); dataQuality.setStatus(Status.error); dataQuality.setErrorText("Test"); @@ -42,8 +42,8 @@ public class VnfcTests { aVNFC.addAttribute(attribute); assertTrue("VNFC name doesn't match", aVNFC.getName().equals("VNFC name")); assertTrue("VNFC invariant uuid doesn't match", aVNFC.getInvariantUuid().equals("Invariant Uuid")); - assertTrue("VNFC NFC Naming Code doesn't match", aVNFC.getNfcNamingCode().equals("NFC Naming Code")); assertTrue("VNFC uuid doesn't match", aVNFC.getUuid().equals("Uuid")); + assertTrue("VNFC type doesn't match", aVNFC.getType().equals("Type")); assertTrue("VNFC data quality status doesn't match", aVNFC.getDataQuality().getStatus().equals(Status.error)); assertTrue("VNFC data quality error text doesn't match", aVNFC.getDataQuality().getErrorText().equals("Test")); assertTrue("VNFC attribute name doesn't match", aVNFC.getAttributes().get(0).getName().equals(Name.hostName)); -- cgit 1.2.3-korg