Remove isNullVersion from identifier class 12/89812/1
authorJim Hahn <jrh3@att.com>
Thu, 13 Jun 2019 14:02:07 +0000 (10:02 -0400)
committerJim Hahn <jrh3@att.com>
Thu, 13 Jun 2019 14:02:07 +0000 (10:02 -0400)
ToscaPolicyIdentifierOptVersion had an isNullVersion() method
which is not being used.  Removed this version, thus eliminating
the need to include a jackson @JsonIgnore annotation.

Change-Id: I03309099a1173591736f69b82b549ebce7994169
Issue-ID: POLICY-1653
Signed-off-by: Jim Hahn <jrh3@att.com>
models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyIdentifierOptVersion.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyIdentifierOptVersionTest.java

index a6aec08..ca3684a 100644 (file)
@@ -20,7 +20,6 @@
 
 package org.onap.policy.models.tosca.authorative.concepts;
 
-import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.google.gson.annotations.SerializedName;
 import lombok.Data;
 import lombok.NoArgsConstructor;
@@ -57,16 +56,6 @@ public class ToscaPolicyIdentifierOptVersion implements Comparable<ToscaPolicyId
         this.version = source.getVersion();
     }
 
-    /**
-     * Determines if the version is null/missing.
-     *
-     * @return {@code true} if the version is null/missing, {@code false}
-     */
-    @JsonIgnore
-    public boolean isNullVersion() {
-        return (version == null);
-    }
-
     @Override
     public int compareTo(ToscaPolicyIdentifierOptVersion other) {
         if (this == other) {
index 1d393c1..2ec2422 100644 (file)
@@ -22,8 +22,6 @@ package org.onap.policy.models.tosca.authorative.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
 
 import org.junit.Test;
 
@@ -45,12 +43,10 @@ public class ToscaPolicyIdentifierOptVersionTest extends ToscaIdentifierTestBase
         ToscaPolicyIdentifierOptVersion orig = new ToscaPolicyIdentifierOptVersion(NAME, null);
         assertEquals(NAME, orig.getName());
         assertEquals(null, orig.getVersion());
-        assertTrue(orig.isNullVersion());
 
         orig = new ToscaPolicyIdentifierOptVersion(NAME, VERSION);
         assertEquals(NAME, orig.getName());
         assertEquals(VERSION, orig.getVersion());
-        assertFalse(orig.isNullVersion());
     }
 
     @Test