diff options
Diffstat (limited to 'models-pdp/src/test/java')
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)); |