OemBO { public String createOem(OemData oemData, String uuid) { try { TblOem tblOem = tblOemJpaController.findTblOemByName(oemData.getName()); if (tblOem != null) { throw new ASException(ErrorCode.WS_OEM_ALREADY_EXISTS, oemData.getName()); } tblOem = new TblOem(); tblOem.setName(oemData.getName()); tblOem.setDescription(oemData.getDescription()); if (uuid != null && !uuid.isEmpty()) { tblOem.setUuid_hex(uuid); } else { tblOem.setUuid_hex(new UUID().toString()); } tblOemJpaController.create(tblOem); } catch (ASException ase) { throw ase; } catch (Exception e) { log.error("Error during OEM creation.", e); throw new ASException(ErrorCode.WS_OEM_CREATE_ERROR, e.getClass().getSimpleName()); } return "true"; } OemBO(); List<OemData> getAllOem(); String updateOem(OemData oemData, String uuid); String createOem(OemData oemData, String uuid); String deleteOem(String oemName, String uuid);  }
@Test public void testCreateOem() { System.out.println("createOem"); OemData oemData = getOemData(); OemBO instance = new OemBO(); boolean found = false; List<OemData> list = instance.getAllOem(); for(OemData r : list) { if( r.getName() != null && r.getName().equals(oemData.getName())) { found = true; } } if( found ) { instance.deleteOem(oemData.getName(),null); } String expResult = "true"; String result = instance.createOem(oemData,null); assertEquals(expResult, result); }