Test repository change

This commit is contained in:
iadgovuser29 2024-06-13 09:26:39 -04:00 committed by chubtub
parent 9fdc8b1bcb
commit 951224abd0
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package hirs.attestationca.persist.entity.manager; package hirs.attestationca.persist.entity.manager;
import hirs.attestationca.persist.entity.userdefined.Device;
import hirs.attestationca.persist.entity.userdefined.SupplyChainValidationSummary; import hirs.attestationca.persist.entity.userdefined.SupplyChainValidationSummary;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -9,4 +10,5 @@ import java.util.UUID;
@Repository @Repository
public interface SupplyChainValidationSummaryRepository extends JpaRepository<SupplyChainValidationSummary, UUID> { public interface SupplyChainValidationSummaryRepository extends JpaRepository<SupplyChainValidationSummary, UUID> {
SupplyChainValidationSummary findByDevice(String device); SupplyChainValidationSummary findByDevice(String device);
SupplyChainValidationSummary findByDevice(Device device);
} }

View File

@ -359,7 +359,8 @@ public class SupplyChainValidationService {
// Generate validation summary, save it, and return it. // Generate validation summary, save it, and return it.
List<SupplyChainValidation> validations = new ArrayList<>(); List<SupplyChainValidation> validations = new ArrayList<>();
SupplyChainValidationSummary previous SupplyChainValidationSummary previous
= this.supplyChainValidationSummaryRepository.findByDevice(deviceName); //= this.supplyChainValidationSummaryRepository.findByDevice(deviceName);
= this.supplyChainValidationSummaryRepository.findByDevice(device);
for (SupplyChainValidation scv : previous.getValidations()) { for (SupplyChainValidation scv : previous.getValidations()) {
if (scv.getValidationType() != SupplyChainValidation.ValidationType.FIRMWARE) { if (scv.getValidationType() != SupplyChainValidation.ValidationType.FIRMWARE) {
validations.add(ValidationService.buildValidationRecord(scv.getValidationType(), validations.add(ValidationService.buildValidationRecord(scv.getValidationType(),