aboutsummaryrefslogtreecommitdiffstats
path: root/models-base/src/test
diff options
context:
space:
mode:
authorrameshiyer27 <ramesh.murugan.iyer@est.tech>2021-02-23 15:10:39 +0000
committerrameshiyer27 <ramesh.murugan.iyer@est.tech>2021-02-25 12:30:55 +0000
commit9d05da454d5adaa894b52e22affd0f155353206b (patch)
treea0b451faa40ddd27a7ccc09e2beafbf9dba5edc5 /models-base/src/test
parent5e4d85d666e319d7fa24ae8ad8c38411f5cdf268 (diff)
Fix Null key issue in PfReferenceTimestampKey
isNUllKey check for PfReferenceTimestamp key is always returning false as the parent class is validating the child object in its method which has additional parameters (timestamp). Fixing the issue by validating only the fields of parent class. Issue-ID: POLICY-3069 Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech> Change-Id: Ie22d09552c9d0cedb7535bda359df0d70e1ebe77
Diffstat (limited to 'models-base/src/test')
-rw-r--r--models-base/src/test/java/org/onap/policy/models/base/PfReferenceTimestampKeyTest.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfReferenceTimestampKeyTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfReferenceTimestampKeyTest.java
index c4762a201..061760aeb 100644
--- a/models-base/src/test/java/org/onap/policy/models/base/PfReferenceTimestampKeyTest.java
+++ b/models-base/src/test/java/org/onap/policy/models/base/PfReferenceTimestampKeyTest.java
@@ -67,9 +67,12 @@ public class PfReferenceTimestampKeyTest {
assertThatThrownBy(() -> new PfReferenceTimestampKey(new PfConceptKey(), null, null))
.hasMessage("parameter \"localName\" is null");
+ assertTrue(new PfReferenceTimestampKey().isNullKey());
+ assertFalse(new PfReferenceTimestampKey("ParentKeyName", VERSION001, PfKey.NULL_KEY_NAME,
+ LOCAL_NAME, Instant.EPOCH).isNullKey());
+
String id = "NULL:0.0.0:NULL:NULL:" + timeStamp;
assertThat(new PfReferenceTimestampKey(id).getTimeStamp().getTime()).isEqualTo(timeStamp);
-
}
@Test