diff options
Diffstat (limited to 'models-dao/src/test')
-rw-r--r-- | models-dao/src/test/java/org/onap/policy/models/dao/DummyConceptEntity.java | 27 | ||||
-rw-r--r-- | models-dao/src/test/java/org/onap/policy/models/dao/DummyReferenceEntity.java | 19 |
2 files changed, 17 insertions, 29 deletions
diff --git a/models-dao/src/test/java/org/onap/policy/models/dao/DummyConceptEntity.java b/models-dao/src/test/java/org/onap/policy/models/dao/DummyConceptEntity.java index fa2e71a08..c61a585ba 100644 --- a/models-dao/src/test/java/org/onap/policy/models/dao/DummyConceptEntity.java +++ b/models-dao/src/test/java/org/onap/policy/models/dao/DummyConceptEntity.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,6 +63,17 @@ public class DummyConceptEntity extends PfConcept { this.key = new PfConceptKey(); } + /** + * Copy constructor. + * + * @param source object from which to copy + */ + public DummyConceptEntity(DummyConceptEntity source) { + this.key = source.key; + this.uuid = source.uuid; + this.description = source.description; + } + public DummyConceptEntity(final Double doubleValue) { this.key = new PfConceptKey(); } @@ -101,21 +113,6 @@ public class DummyConceptEntity extends PfConcept { } @Override - public PfConcept copyTo(final PfConcept target) { - Assertions.argumentNotNull(target, "target may not be null"); - - final PfConcept copyObject = target; - Assertions.instanceOf(copyObject, DummyConceptEntity.class); - - final DummyConceptEntity copy = ((DummyConceptEntity) copyObject); - copy.setKey(key); - copy.setUuid(uuid); - copy.setDescription(description); - - return copyObject; - } - - @Override public int compareTo(final PfConcept otherObj) { Assertions.argumentNotNull(otherObj, "comparison object may not be null"); diff --git a/models-dao/src/test/java/org/onap/policy/models/dao/DummyReferenceEntity.java b/models-dao/src/test/java/org/onap/policy/models/dao/DummyReferenceEntity.java index aad2aa5bc..41ead40cc 100644 --- a/models-dao/src/test/java/org/onap/policy/models/dao/DummyReferenceEntity.java +++ b/models-dao/src/test/java/org/onap/policy/models/dao/DummyReferenceEntity.java @@ -61,6 +61,11 @@ public class DummyReferenceEntity extends PfConcept { this.doubleValue = 123.45; } + public DummyReferenceEntity(DummyReferenceEntity source) { + this.key = source.key; + this.doubleValue = source.doubleValue; + } + /** * Constructor. * @@ -89,20 +94,6 @@ public class DummyReferenceEntity extends PfConcept { key.clean(); } - @Override - public PfConcept copyTo(final PfConcept target) { - Assertions.argumentNotNull(target, "target may not be null"); - - final PfConcept copyObject = target; - Assertions.instanceOf(copyObject, DummyReferenceEntity.class); - - final DummyReferenceEntity copy = ((DummyReferenceEntity) copyObject); - copy.setKey(key); - copy.setDoubleValue(doubleValue); - - return copyObject; - } - @Override public int compareTo(final PfConcept otherObj) { |