aboutsummaryrefslogtreecommitdiffstats
path: root/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ArtifactKeyTestEntity.java
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ArtifactKeyTestEntity.java')
-rw-r--r--testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ArtifactKeyTestEntity.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ArtifactKeyTestEntity.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ArtifactKeyTestEntity.java
index 3b8394dbb..500405422 100644
--- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ArtifactKeyTestEntity.java
+++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ArtifactKeyTestEntity.java
@@ -33,6 +33,7 @@ import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
+import org.apache.commons.lang3.builder.CompareToBuilder;
import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
import org.onap.policy.apex.model.basicmodel.concepts.AxConcept;
import org.onap.policy.apex.model.basicmodel.concepts.AxKey;
@@ -143,13 +144,9 @@ public class ArtifactKeyTestEntity extends AxConcept {
return -1;
}
final ArtifactKeyTestEntity other = (ArtifactKeyTestEntity) otherObj;
- if (key == null) {
- if (other.key != null) {
- return 1;
- }
- } else if (!key.equals(other.key)) {
- return key.compareTo(other.key);
- }
- return Double.compare(doubleValue, other.doubleValue);
+ return new CompareToBuilder()
+ .append(key, other.key)
+ .append(doubleValue, other.doubleValue)
+ .toComparison();
}
}