use of com.intel.mtwilson.datatypes.AttestationReport in project OpenAttestation by OpenAttestation.
the class ReportsBOTest method testGetAttestationReport.
@Test
public void testGetAttestationReport() throws NumberFormatException, IOException {
when(tblHostsJpaController.findByName(anyString())).thenReturn(mockFindByName());
when(tblTaLogJpaController.findLastStatusTs(any(Integer.class))).thenReturn(new Date());
List<TblTaLog> taLogs = new ArrayList<TblTaLog>();
taLogs.add(new TblTaLog(Integer.valueOf(1), 1, 1, "18", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", true, new Date()));
when(tblTaLogJpaController.findLogsByHostId(anyInt(), any(Date.class))).thenReturn(taLogs);
AttestationReport attestationReport = reportsBO.getAttestationReport(new Hostname(SERVER_NAME), false);
assertNotNull(attestationReport);
assertTrue(attestationReport.getPcrLogs().size() > 0);
}
use of com.intel.mtwilson.datatypes.AttestationReport in project OpenAttestation by OpenAttestation.
the class DemoPortalServicesImpl method getFailureReportData.
/**
* This method is used to get failure report for Host.
*
* @param hostName
* @param attestationService
* @return
* @throws DemoPortalException
* @throws Exception
*/
@Override
public List<PcrLogReport> getFailureReportData(String hostName, ApiClient attestationService) throws Exception {
log.info("DemoPortalServicesImpl.getFailureReportData >>");
AttestationReport report;
try {
report = attestationService.getAttestationReport(new Hostname(hostName));
} catch (Exception e) {
log.error(e.getMessage());
throw ConnectionUtil.handleException(e);
}
return report.getPcrLogs();
}
Aggregations