Merge pull request #654 from nsacyber/v3_minor-unittest-updates

Creation Date fix
This commit is contained in:
Cyrus 2023-12-21 10:49:32 -05:00 committed by GitHub
commit 07b8bea085
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 7 deletions

View File

@ -7,9 +7,6 @@ import jakarta.persistence.MappedSuperclass;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.Generated;
import org.hibernate.annotations.GenerationTime;
import org.hibernate.annotations.UuidGenerator;
import java.io.Serializable;
@ -38,9 +35,7 @@ public abstract class AbstractEntity implements Serializable {
private UUID id;
@Column (name = "create_time")
@ColumnDefault(value = "CURRENT_TIMESTAMP")
@Generated(GenerationTime.INSERT)
private Date createTime = new Date();
private Date createTime;
/**
* Default empty constructor is required for Hibernate. It is protected to
@ -48,6 +43,7 @@ public abstract class AbstractEntity implements Serializable {
*/
protected AbstractEntity() {
super();
createTime = new Date();
}
/**

View File

@ -16,5 +16,6 @@ public interface EndorsementCredentialRepository extends JpaRepository<Endorseme
List<EndorsementCredential> findByArchiveFlag(boolean archiveFlag);
Page<EndorsementCredential> findByArchiveFlag(boolean archiveFlag, Pageable pageable);
EndorsementCredential findByHolderSerialNumber(BigInteger holderSerialNumber);
EndorsementCredential findBySerialNumber(BigInteger serialNumber);
List<EndorsementCredential> findByDeviceId(UUID deviceId);
}

View File

@ -253,7 +253,7 @@ public class CertificatePageController extends PageController<NoPageParams> {
PlatformCredential pc = (PlatformCredential) records.get(i);
// find the EC using the PC's "holder serial number"
associatedEC = this.endorsementCredentialRepository
.findByHolderSerialNumber(pc.getHolderSerialNumber());
.findBySerialNumber(pc.getHolderSerialNumber());
if (associatedEC != null) {
log.debug("EC ID for holder s/n " + pc