Undoing addition to HIRS_AttestationCA build.gradle file; Adding tests to DeviceTest

This commit is contained in:
iadgovuser62 2024-01-10 14:57:56 -05:00
parent 2b594571b5
commit 09284caa57
2 changed files with 23 additions and 1 deletions

View File

@ -29,7 +29,6 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa:3.0.1'
implementation 'com.github.darrachequesne:spring-data-jpa-datatables:6.0.1'
implementation 'org.springframework.retry:spring-retry:2.0.0'
implementation 'org.springframework:spring-test:6.0.11'
implementation libs.springdatajpa
implementation libs.bouncycastle

View File

@ -151,4 +151,27 @@ public final class DeviceTest {
final Device other = new Device(otherName, deviceInfo, HealthStatus.UNKNOWN, AppraisalStatus.Status.UNKNOWN, null, false, null, null);
assertEquals(device, other);
}
/**
* Tests that the default setting of the supply chain validation status is unknown.
*/
@Test
public void testGetDefaultSupplyChainStatus() {
String name = "my-laptop";
DeviceInfoReport deviceInfo = DeviceInfoReportTest.getTestReport();
final Device device = new Device(name, deviceInfo, HealthStatus.UNKNOWN, AppraisalStatus.Status.UNKNOWN, null, false, null, null);
assertEquals(AppraisalStatus.Status.UNKNOWN, device.getSupplyChainValidationStatus());
}
/**
* Tests that the supply chain validation status getters and setters work.
*/
@Test
public void testSetAndGetSupplyChainStatus() {
String name = "my-laptop";
DeviceInfoReport deviceInfo = DeviceInfoReportTest.getTestReport();
final Device device = new Device(name, deviceInfo, HealthStatus.UNKNOWN, AppraisalStatus.Status.UNKNOWN, null, false, null, null);
device.setSupplyChainValidationStatus(AppraisalStatus.Status.PASS);
assertEquals(AppraisalStatus.Status.PASS, device.getSupplyChainValidationStatus());
}
}