use of com.intel.mtwilson.datatypes.OemData in project OpenAttestation by OpenAttestation.
the class OemBOTest method testGetAllOem.
@Test
public void testGetAllOem() {
List<TblOem> allRecords = new ArrayList<TblOem>();
TblOem tblOem1 = new TblOem(OEM_ID1);
TblOem tblOem2 = new TblOem(OEM_ID2);
allRecords.add(tblOem1);
allRecords.add(tblOem2);
doReturn(allRecords).when(tblOemJpaController).findTblOemEntities();
List<OemData> allData = oemBO.getAllOem();
assertNotNull(allData);
assertEquals(2, allData.size());
}
use of com.intel.mtwilson.datatypes.OemData in project OpenAttestation by OpenAttestation.
the class OEMClientServiceImpl method addOEMInfo.
/**
* Method to add OEM Type into a Rest Services
*
* @param dataVO
* @param apiClientServices
* @return Boolean variable e.g true if OEM is added successfully
* @throws WLMPortalException
*/
@Override
public boolean addOEMInfo(OEMDataVO dataVO, WhitelistService apiClientServices) throws WLMPortalException {
log.info("OEMClientServiceImpl.addOEMInfo >>");
boolean result = false;
try {
apiClientServices.addOEM(new OemData(dataVO.getOemName(), dataVO.getOemDescription()));
result = true;
} catch (Exception e) {
log.error(e.getMessage());
throw ConnectionUtil.handleException(e);
}
log.info("OEMClientServiceImpl.addOEMInfo <<");
return result;
}
use of com.intel.mtwilson.datatypes.OemData in project OpenAttestation by OpenAttestation.
the class OEMClientServiceImpl method updateOEMInfo.
/**
* Method to update OEM into a Rest Services
*
* @param dataVO
* @param apiClientServices
* @return Boolean variable e.g true if OEM is updated successfully
* @throws WLMPortalException
*/
@Override
public boolean updateOEMInfo(OEMDataVO dataVO, WhitelistService apiClientServices) throws WLMPortalException {
log.info("OEMClientServiceImpl.updateOEMInfo >>");
boolean result = false;
try {
apiClientServices.updateOEM(new OemData(dataVO.getOemName(), dataVO.getOemDescription()));
result = true;
} catch (Exception e) {
log.error(e.getMessage());
throw ConnectionUtil.handleException(e);
}
log.info("OEMClientServiceImpl.updateOEMInfo <<");
return result;
}
use of com.intel.mtwilson.datatypes.OemData in project OpenAttestation by OpenAttestation.
the class ConverterUtil method getListToOEMDataVO.
public static List<OEMDataVO> getListToOEMDataVO(List<OemData> oemList) {
List<OEMDataVO> list = new ArrayList<OEMDataVO>();
for (OemData data : oemList) {
OEMDataVO osVo = new OEMDataVO();
osVo.setOemName(data.getName());
osVo.setOemDescription(data.getDescription());
list.add(osVo);
}
return list;
}
use of com.intel.mtwilson.datatypes.OemData in project OpenAttestation by OpenAttestation.
the class OemBO method getAllOem.
/**
*
* @return
*/
public List<OemData> getAllOem() {
List<OemData> allOemData = new ArrayList<OemData>();
try {
List<TblOem> allRecords = tblOemJpaController.findTblOemEntities();
for (TblOem tblOem : allRecords) {
OemData oemData = new OemData(tblOem.getName(), tblOem.getDescription());
allOemData.add(oemData);
}
} catch (ASException ase) {
throw ase;
} catch (Exception e) {
throw new ASException(e);
}
return allOemData;
}
Aggregations