MleBO { public String addMLe(MleData mleData, String mleUuid) { String osOemUuid = null; try { log.debug("add mle type: {}", mleData.getMleType()); log.debug("add mle name: {}", mleData.getName()); log.debug("add mle version: {}", mleData.getVersion()); log.debug("add mle os name: {}", mleData.getOsName()); log.debug("add mle os version: {}", mleData.getOsVersion()); log.debug("add mle oem: {}", mleData.getOemName()); log.debug("add mle attestation type: {}", mleData.getAttestationType()); log.debug("add mle target type: {}", mleData.getTarget_type()); log.debug("add mle target value: {}", mleData.getTarget_value()); TblMle tblMle = getMleDetails(mleData.getName(), mleData.getVersion(), mleData.getOsName(), mleData.getOsVersion(), mleData.getOemName()); if (tblMle != null) { throw new ASException(ErrorCode.WS_MLE_ALREADY_EXISTS, mleData.getName()); } if (mleData.getMleType().equals("VMM")) { TblOs osObj = My.jpa().mwOs().findTblOsByNameVersion(mleData.getOsName(), mleData.getOsVersion()); osOemUuid = osObj.getUuid_hex(); } else if (mleData.getMleType().equals("BIOS")) { TblOem oemObj = My.jpa().mwOem().findTblOemByName(mleData.getOemName()); osOemUuid = oemObj.getUuid_hex(); } tblMle = getTblMle(mleData, mleUuid, osOemUuid); if (mleData.getManifestList() != null) { for (ManifestData pcrData : mleData.getManifestList()) { validateWhitelistValue(pcrData.getPcrBank(), pcrData.getName(), pcrData.getValue()); } } mleJpaController.create(tblMle); addPcrManifest(tblMle, mleData.getManifestList(), null, null); } catch (ASException ase) { throw ase; } catch (Exception e) { log.error("Error during MLE creation.", e); throw new ASException(ErrorCode.WS_MLE_CREATE_ERROR, e.getClass().getSimpleName()); } return "true"; } MleBO(); String addMLe(MleData mleData, String mleUuid); String updateMle(MleData mleData, String mleUuid); String deleteMle(String mleName, String mleVersion, String osName, String osVersion, String oemName, String mleUuid); List<MleData> listMles(String searchCriteria); MleData findMle(String mleName, String mleVersion, String osName, String osVersion, String oemName); MleData createMleDataFromDatabaseRecord(TblMle tblMle, boolean addManifest); String addPCRWhiteList(PCRWhiteList pcrData); String addPCRWhiteList(PCRWhiteList pcrData, EntityManager em, String uuid, String mleUuid); String updatePCRWhiteList(PCRWhiteList pcrData); String updatePCRWhiteList(PCRWhiteList pcrData, EntityManager em, String uuid); String deletePCRWhiteList(String pcrName, String algorithmBank, String mleName, String mleVersion, String osName, String osVersion, String oemName, String pcrUuid); String addModuleWhiteList(ModuleWhiteList moduleData); String addModuleWhiteList(ModuleWhiteList moduleData, EntityManager em, String uuid, String mleUuid); String updateModuleWhiteList(ModuleWhiteList moduleData); String updateModuleWhiteList(ModuleWhiteList moduleData, EntityManager em, String uuid); String deleteModuleWhiteList(String componentName, String eventName, String pcrBank, String mleName, String mleVersion,
            String osName, String osVersion, String oemName, String uuid); List<ModuleWhiteList> getModuleWhiteList(String mleName, String mleVersion,
            String osName, String osVersion, String oemName); String addMleSource(MleSource mleSourceObj, String uuid, String mleUuid); String updateMleSource(MleSource mleSourceObj, String mleUuid); String deleteMleSource(String mleName, String mleVersion, String osName, String osVersion, String oemName, String mleUuid); String getMleSource(String mleName, String mleVersion, String osName, String osVersion, String oemName);  }
@Test public void testAddMleVmm() { System.out.println("addMLeVmm"); MleBO instance = new MleBO(); String expResult = "true"; String result = instance.addMLe(getVmmMle(), null); assertEquals(expResult, result); }
@Test public void testAddMleBios() { System.out.println("addMLeBios"); MleBO instance = new MleBO(); String expResult = "true"; String result = instance.addMLe(getBiosMle(), null); assertEquals(expResult, result); }