summaryrefslogtreecommitdiffstats
path: root/models-pdp/src/main
diff options
context:
space:
mode:
authorhuaxing <huaxing.jin@est.tech>2020-02-13 11:40:35 +0800
committerhuaxing <huaxing.jin@est.tech>2020-02-17 09:54:02 +0800
commit9105d83bbfe5635e2a571efbc534fbce6d17d7f1 (patch)
tree4fb40d04f2343dec4d9f964cabc703a2a8a8ace3 /models-pdp/src/main
parentad1cd2013f45da5764fc9610db1f679d3c3762cb (diff)
Add/Update test cases for PdpStatistics entity
Add test cases for PdpStatistics / PdpEngineWorkerStatistics / JpaPdpStatistics. Add lombok.Data annotation to PdpStatistics and PdpEngineWorkerStatistics to facilitate testing. Issue-ID: POLICY-1628 Signed-off-by: huaxing <huaxing.jin@est.tech> Change-Id: I4269678641716a56db260ad67a30c97b904123cd
Diffstat (limited to 'models-pdp/src/main')
-rw-r--r--models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpEngineWorkerStatistics.java13
-rw-r--r--models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpStatistics.java12
2 files changed, 10 insertions, 15 deletions
diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpEngineWorkerStatistics.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpEngineWorkerStatistics.java
index 43fa6c072..06f603069 100644
--- a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpEngineWorkerStatistics.java
+++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpEngineWorkerStatistics.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019-2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,16 +22,13 @@ package org.onap.policy.models.pdp.concepts;
import java.io.Serializable;
import javax.persistence.Embeddable;
-import lombok.Getter;
+import lombok.Data;
import lombok.NoArgsConstructor;
-import lombok.Setter;
-import lombok.ToString;
+import lombok.NonNull;
import org.onap.policy.models.pdp.enums.PdpEngineWorkerState;
@Embeddable
-@Getter
-@Setter
-@ToString
+@Data
@NoArgsConstructor
public class PdpEngineWorkerStatistics implements Serializable {
private static final long serialVersionUID = 8262176849743624013L;
@@ -51,7 +48,7 @@ public class PdpEngineWorkerStatistics implements Serializable {
*
* @param source source from which to copy
*/
- public PdpEngineWorkerStatistics(PdpEngineWorkerStatistics source) {
+ public PdpEngineWorkerStatistics(@NonNull PdpEngineWorkerStatistics source) {
this.engineId = source.engineId;
this.engineWorkerState = source.engineWorkerState;
this.engineTimeStamp = source.engineTimeStamp;
diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpStatistics.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpStatistics.java
index ad5547ecf..1ba983be2 100644
--- a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpStatistics.java
+++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpStatistics.java
@@ -2,6 +2,7 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
* Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ * Modifications Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,10 +24,9 @@ package org.onap.policy.models.pdp.concepts;
import java.util.Date;
import java.util.List;
-import lombok.Getter;
+import lombok.Data;
import lombok.NoArgsConstructor;
-import lombok.Setter;
-import lombok.ToString;
+import lombok.NonNull;
import org.onap.policy.models.base.PfUtils;
/**
@@ -34,9 +34,7 @@ import org.onap.policy.models.base.PfUtils;
*
* @author Ram Krishna Verma (ram.krishna.verma@est.tech)
*/
-@Getter
-@Setter
-@ToString
+@Data
@NoArgsConstructor
public class PdpStatistics {
@@ -57,7 +55,7 @@ public class PdpStatistics {
*
* @param source source from which to copy
*/
- public PdpStatistics(PdpStatistics source) {
+ public PdpStatistics(@NonNull PdpStatistics source) {
this.pdpInstanceId = source.pdpInstanceId;
this.timeStamp = source.timeStamp == null ? null : new Date(source.timeStamp.getTime());
this.pdpGroupName = source.pdpGroupName;