mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-28 08:48:59 +00:00
fixed issue caused by change to version method
This commit is contained in:
parent
80ba36cbf2
commit
939240d284
@ -7,6 +7,7 @@ import hirs.attestationca.persist.entity.userdefined.info.NetworkInfo;
|
|||||||
import hirs.attestationca.persist.entity.userdefined.info.HardwareInfo;
|
import hirs.attestationca.persist.entity.userdefined.info.HardwareInfo;
|
||||||
import hirs.attestationca.persist.entity.userdefined.info.FirmwareInfo;
|
import hirs.attestationca.persist.entity.userdefined.info.FirmwareInfo;
|
||||||
|
|
||||||
|
import hirs.utils.VersionHelper;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
@ -21,7 +22,7 @@ public class DeviceInfoReportTest extends AbstractUserdefinedEntityTest {
|
|||||||
private final HardwareInfo hardwareInfo = createTestHardwareInfo();
|
private final HardwareInfo hardwareInfo = createTestHardwareInfo();
|
||||||
private final TPMInfo tpmInfo = createTPMInfo();
|
private final TPMInfo tpmInfo = createTPMInfo();
|
||||||
|
|
||||||
private static final String EXPECTED_CLIENT_VERSION = "Test.Version";
|
private static final String EXPECTED_CLIENT_VERSION = VersionHelper.getVersion();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests instantiation of a DeviceInfoReport.
|
* Tests instantiation of a DeviceInfoReport.
|
||||||
|
@ -1 +0,0 @@
|
|||||||
Test.Version
|
|
@ -2,8 +2,7 @@ package hirs.utils;
|
|||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for VersionHelper.
|
* Tests for VersionHelper.
|
||||||
@ -11,21 +10,11 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
|||||||
public class VersionHelperTest {
|
public class VersionHelperTest {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test that case where a version file does not exist.
|
* Test that a version file exists in /opt/hirs or /etc/hirs and is not empty.
|
||||||
*/
|
|
||||||
@Test
|
|
||||||
public void testGetVersionFail() {
|
|
||||||
String actual = VersionHelper.getVersion("somefile");
|
|
||||||
assertTrue(actual.startsWith(""));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test that a version file exists and can be read properly.
|
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testGetVersionDefault() {
|
public void testGetVersionDefault() {
|
||||||
String expected = "Test.Version";
|
String actual = VersionHelper.getVersion();
|
||||||
String actual = VersionHelper.getVersion("VERSION");
|
assertNotNull(actual);
|
||||||
assertEquals(expected, actual);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1 +0,0 @@
|
|||||||
Test.Version
|
|
Loading…
Reference in New Issue
Block a user