summaryrefslogtreecommitdiffstats
path: root/models-pap/src
diff options
context:
space:
mode:
Diffstat (limited to 'models-pap/src')
-rw-r--r--models-pap/src/main/java/org/onap/policy/models/pap/persistence/concepts/JpaPolicyAudit.java19
-rw-r--r--models-pap/src/test/java/org/onap/policy/models/pap/persistence/concepts/JpaPolicyAuditTest.java2
-rw-r--r--models-pap/src/test/resources/META-INF/persistence.xml4
3 files changed, 13 insertions, 12 deletions
diff --git a/models-pap/src/main/java/org/onap/policy/models/pap/persistence/concepts/JpaPolicyAudit.java b/models-pap/src/main/java/org/onap/policy/models/pap/persistence/concepts/JpaPolicyAudit.java
index 35e385637..e2f8972de 100644
--- a/models-pap/src/main/java/org/onap/policy/models/pap/persistence/concepts/JpaPolicyAudit.java
+++ b/models-pap/src/main/java/org/onap/policy/models/pap/persistence/concepts/JpaPolicyAudit.java
@@ -63,7 +63,9 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
*
*/
@Entity
-@Table(name = "JpaPolicyAudit", indexes = {@Index(name = "JpaPolicyAuditIndex_timestamp", columnList = "timeStamp")})
+@Table(name = "JpaPolicyAudit", indexes = {
+ @Index(name = "JpaPolicyAuditIndex_timestamp", columnList = "timeStamp")
+})
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@Data
@EqualsAndHashCode(callSuper = false)
@@ -105,7 +107,7 @@ public class JpaPolicyAudit extends PfConcept implements PfAuthorative<PolicyAud
private Date timeStamp;
@Column
- private String user;
+ private String userName;
/**
* Default constructor.
@@ -137,7 +139,7 @@ public class JpaPolicyAudit extends PfConcept implements PfAuthorative<PolicyAud
this.pdpType = copyConcept.getPdpType();
this.action = copyConcept.getAction();
this.timeStamp = copyConcept.getTimeStamp();
- this.user = copyConcept.getUser();
+ this.userName = copyConcept.getUserName();
}
@Override
@@ -163,7 +165,7 @@ public class JpaPolicyAudit extends PfConcept implements PfAuthorative<PolicyAud
.append(pdpType, other.pdpType)
.append(action, other.action)
.append(timeStamp, other.timeStamp)
- .append(user, other.user)
+ .append(userName, other.userName)
.toComparison();
// @formatter:on
}
@@ -180,7 +182,7 @@ public class JpaPolicyAudit extends PfConcept implements PfAuthorative<PolicyAud
.policy(policyIdent)
.action(action)
.timestamp(timeStamp == null ? null : timeStamp.toInstant())
- .user(user)
+ .user(userName)
.build();
// @formatter:on
}
@@ -200,11 +202,10 @@ public class JpaPolicyAudit extends PfConcept implements PfAuthorative<PolicyAud
pdpType = authorativeConcept.getPdpType();
action = authorativeConcept.getAction();
timeStamp = authorativeConcept.getTimestamp() == null ? Date.from(Instant.now())
- : Date.from(authorativeConcept.getTimestamp());
- user = authorativeConcept.getUser();
+ : Date.from(authorativeConcept.getTimestamp());
+ userName = authorativeConcept.getUser();
}
-
@Override
public List<PfKey> getKeys() {
final List<PfKey> keyList = new ArrayList<>();
@@ -221,7 +222,7 @@ public class JpaPolicyAudit extends PfConcept implements PfAuthorative<PolicyAud
public void clean() {
pdpGroup = Assertions.validateStringParameter("pdpGroup", pdpGroup, PfReferenceKey.LOCAL_NAME_REGEXP);
pdpType = Assertions.validateStringParameter("pdpType", pdpType, PfReferenceKey.LOCAL_NAME_REGEXP);
- user = Assertions.validateStringParameter("user", user, PfReferenceKey.LOCAL_NAME_REGEXP);
+ userName = Assertions.validateStringParameter("user", userName, PfReferenceKey.LOCAL_NAME_REGEXP);
}
@Override
diff --git a/models-pap/src/test/java/org/onap/policy/models/pap/persistence/concepts/JpaPolicyAuditTest.java b/models-pap/src/test/java/org/onap/policy/models/pap/persistence/concepts/JpaPolicyAuditTest.java
index 4f8693304..25d7304ee 100644
--- a/models-pap/src/test/java/org/onap/policy/models/pap/persistence/concepts/JpaPolicyAuditTest.java
+++ b/models-pap/src/test/java/org/onap/policy/models/pap/persistence/concepts/JpaPolicyAuditTest.java
@@ -84,7 +84,7 @@ public class JpaPolicyAuditTest {
audit.setUser(" user");
JpaPolicyAudit jpaAudit = new JpaPolicyAudit(audit);
assertThatNoException().isThrownBy(() -> jpaAudit.clean());
- assertEquals(USER, jpaAudit.getUser());
+ assertEquals(USER, jpaAudit.getUserName());
}
@Test
diff --git a/models-pap/src/test/resources/META-INF/persistence.xml b/models-pap/src/test/resources/META-INF/persistence.xml
index 58e2deca3..fcab08f3e 100644
--- a/models-pap/src/test/resources/META-INF/persistence.xml
+++ b/models-pap/src/test/resources/META-INF/persistence.xml
@@ -31,7 +31,7 @@
<property name="eclipselink.ddl-generation.output-mode" value="database" />
<property name="eclipselink.logging.level" value="INFO" />
- <property name="eclipselink.logging.level" value="ALL" />
+ <!--property name="eclipselink.logging.level" value="ALL" />
<property name="eclipselink.logging.level.jpa" value="ALL" />
<property name="eclipselink.logging.level.ddl" value="ALL" />
<property name="eclipselink.logging.level.connection" value="ALL" />
@@ -40,7 +40,7 @@
<property name="eclipselink.logging.level.sequencing" value="ALL" />
<property name="eclipselink.logging.level.server" value="ALL" />
<property name="eclipselink.logging.level.query" value="ALL" />
- <property name="eclipselink.logging.level.properties" value="ALL" />
+ <property name="eclipselink.logging.level.properties" value="ALL" /-->
</properties>
</persistence-unit>
</persistence>