diff options
author | Liam Fallon <liam.fallon@est.tech> | 2019-03-31 23:17:59 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-03-31 23:17:59 +0000 |
commit | fbed360c0acdc127fdf56a99401c1aea691ce57e (patch) | |
tree | 1b61422a0c4984365ef506ce5661f9e475a2bb8a /models-pdp/src/test | |
parent | 96585ff6166369ae6c3f5326e56d55114ae6a3e0 (diff) | |
parent | cc5b96bfd33cd7d91fe6994d348e8d6a0ebb54fa (diff) |
Merge "Restructure for authorative models"
Diffstat (limited to 'models-pdp/src/test')
3 files changed, 14 insertions, 10 deletions
diff --git a/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/TestPdpGroup.java b/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/TestPdpGroup.java index 51bb66c97..cac506acc 100644 --- a/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/TestPdpGroup.java +++ b/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/TestPdpGroup.java @@ -43,11 +43,14 @@ public class TestPdpGroup { PdpGroup orig = new PdpGroup(); // verify with null values - assertEquals("PdpGroup(pdpGroupState=null, properties=null, pdpSubgroups=[])", new PdpGroup(orig).toString()); + assertEquals("PdpGroup(name=null, version=null, description=null, pdpGroupState=null, " + + "properties=null, pdpSubgroups=[])", new PdpGroup(orig).toString()); // verify with all values orig.setDescription("my-descript"); - orig.getKey().setName("my-name"); + orig.setName("my-name"); + orig.setVersion("my-version"); + orig.setDescription("my-description"); orig.setPdpGroupState(PdpState.SAFE); PdpSubGroup sub1 = new PdpSubGroup(); @@ -61,7 +64,8 @@ public class TestPdpGroup { props.put("key-B", "value-B"); orig.setProperties(props); - assertEquals("PdpGroup(pdpGroupState=SAFE, properties={key-A=value-A, key-B=value-B}, " + assertEquals("PdpGroup(name=my-name, version=my-version, description=my-description, " + + "pdpGroupState=SAFE, properties={key-A=value-A, key-B=value-B}, " + "pdpSubgroups=[PdpSubGroup(pdpType=null, supportedPolicyTypes=[], policies=[], " + "currentInstanceCount=10, desiredInstanceCount=0, properties=null, pdpInstances=[]), " + "PdpSubGroup(pdpType=null, supportedPolicyTypes=[], policies=[], currentInstanceCount=11, " diff --git a/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/TestPdpInstanceDetails.java b/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/TestPdpInstanceDetails.java index 2220ae126..79bb52ee8 100644 --- a/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/TestPdpInstanceDetails.java +++ b/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/TestPdpInstanceDetails.java @@ -34,12 +34,12 @@ public class TestPdpInstanceDetails { @Test public void testCopyConstructor() { - assertThatThrownBy(() -> new PdpInstanceDetails(null)).isInstanceOf(NullPointerException.class); + assertThatThrownBy(() -> new Pdp(null)).isInstanceOf(NullPointerException.class); - PdpInstanceDetails orig = new PdpInstanceDetails(); + Pdp orig = new Pdp(); // verify with null values - assertEquals(orig.toString(), new PdpInstanceDetails(orig).toString()); + assertEquals(orig.toString(), new Pdp(orig).toString()); // verify with all values orig.setHealthy(PdpHealthStatus.TEST_IN_PROGRESS); @@ -47,6 +47,6 @@ public class TestPdpInstanceDetails { orig.setMessage("my-message"); orig.setPdpState(PdpState.SAFE); - assertEquals(orig.toString(), new PdpInstanceDetails(orig).toString()); + assertEquals(orig.toString(), new Pdp(orig).toString()); } } diff --git a/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/TestPdpSubGroup.java b/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/TestPdpSubGroup.java index bc6363fae..eac2fb5d6 100644 --- a/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/TestPdpSubGroup.java +++ b/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/TestPdpSubGroup.java @@ -28,7 +28,7 @@ import java.util.Arrays; import java.util.Map; import java.util.TreeMap; import org.junit.Test; -import org.onap.policy.models.tosca.simple.concepts.ToscaPolicy; +import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; /** * Test the copy constructor, as {@link TestModels} tests the other methods. @@ -51,9 +51,9 @@ public class TestPdpSubGroup { orig.setCurrentInstanceCount(10); orig.setDesiredInstanceCount(11); - PdpInstanceDetails inst1 = new PdpInstanceDetails(); + Pdp inst1 = new Pdp(); inst1.setInstanceId("my-id-A"); - PdpInstanceDetails inst2 = new PdpInstanceDetails(); + Pdp inst2 = new Pdp(); inst2.setInstanceId("my-id-B"); orig.setPdpInstances(Arrays.asList(inst1, inst2)); |