File tree Expand file tree Collapse file tree 4 files changed +6
-18
lines changed
HIRS_AttestationCA/src/test
java/hirs/attestationca/persist/entity/userdefined/report Expand file tree Collapse file tree 4 files changed +6
-18
lines changed Original file line number Diff line number Diff line change 7
7
import hirs .attestationca .persist .entity .userdefined .info .HardwareInfo ;
8
8
import hirs .attestationca .persist .entity .userdefined .info .FirmwareInfo ;
9
9
10
+ import hirs .utils .VersionHelper ;
10
11
import org .junit .jupiter .api .Test ;
11
12
import static org .junit .jupiter .api .Assertions .assertEquals ;
12
13
import static org .junit .jupiter .api .Assertions .assertThrows ;
@@ -21,7 +22,7 @@ public class DeviceInfoReportTest extends AbstractUserdefinedEntityTest {
21
22
private final HardwareInfo hardwareInfo = createTestHardwareInfo ();
22
23
private final TPMInfo tpmInfo = createTPMInfo ();
23
24
24
- private static final String EXPECTED_CLIENT_VERSION = "Test.Version" ;
25
+ private static final String EXPECTED_CLIENT_VERSION = VersionHelper . getVersion () ;
25
26
26
27
/**
27
28
* Tests instantiation of a DeviceInfoReport.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2
2
3
3
import org .junit .jupiter .api .Test ;
4
4
5
- import static org .junit .jupiter .api .Assertions .assertTrue ;
6
- import static org .junit .jupiter .api .Assertions .assertEquals ;
5
+ import static org .junit .jupiter .api .Assertions .assertNotNull ;
7
6
8
7
/**
9
8
* Tests for VersionHelper.
10
9
*/
11
10
public class VersionHelperTest {
12
11
13
12
/**
14
- * Test that case where a version file does not exist.
15
- */
16
- @ Test
17
- public void testGetVersionFail () {
18
- String actual = VersionHelper .getVersion ("somefile" );
19
- assertTrue (actual .startsWith ("" ));
20
- }
21
-
22
- /**
23
- * Test that a version file exists and can be read properly.
13
+ * Test that a version file exists in /opt/hirs or /etc/hirs and is not empty.
24
14
*/
25
15
@ Test
26
16
public void testGetVersionDefault () {
27
- String expected = "Test.Version" ;
28
- String actual = VersionHelper .getVersion ("VERSION" );
29
- assertEquals (expected , actual );
17
+ String actual = VersionHelper .getVersion ();
18
+ assertNotNull (actual );
30
19
}
31
20
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments