DMZSyncServiceImpl extends RemoteServiceServlet implements
		DMZSyncService { @Override public List<String> pushToDMZ(Long standardizedPatientId,String locale) throws DMZSyncException { StandardizedPatient patient = findPatient(standardizedPatientId); AnamnesisChecksValue.fillAnamnesisChecksValues(patient.getAnamnesisForm().getId()); patient.getAnamnesisForm().setAnamnesischecksvalues(AnamnesisChecksValue.findAnamnesisChecksValueForSetAnamnesisCheck(patient.getAnamnesisForm().getId())); String json = ""; String url = ""; List<String> errorMessages = null; if(patient !=null){ try{ JSONSerializer serializer = new JSONSerializer(); json = serializer .include("*.class","anamnesisForm","anamnesisForm.anamnesischecksvalues" ,"anamnesisForm.scars","anamnesisForm.anamnesischecksvalues.values.anamnesisform" ,"bankAccount.IBAN","bankAccount.BIC" ,"description","profession","nationality","langskills") .transform(new DateTransformer("yyyy-MM-dd'T'HH:mm:ss'Z'"), "birthday") .transform(new DateTransformer("yyyy-MM-dd'T'HH:mm:ss'Z'"), "anamnesisForm.createDate") .serialize(patient); json = processSendJson(json,locale); }catch(Exception e){ throw new DMZSyncException(DMZSyncExceptionType.SERIALIZING_EXCEPTION,e.getMessage()); } url = getHostAddress() + "/DataImportExport/importSP"; String returnJson = sendData(json,url); errorMessages = getSendReturnErrorMessage(returnJson); }else{ throw new DMZSyncException(DMZSyncExceptionType.PATIENT_EXIST_EXCEPTION,""); } return errorMessages; }  @Override List<String> pushToDMZ(Long standardizedPatientId,String locale); @Override void pullFromDMZ(Long standardizedPatientId); @Override String sendSync(String locale); @Override void getSync(String locale); String preProcessData(String data);  }
@Test public void testPushToDMZ() { try { instance.pushToDMZ(22L,"en"); } catch (Exception e) { e.printStackTrace(); e.getCause().printStackTrace(); Assert.fail("error occured " + e.getMessage()); } assertEquals((Long)22L, (Long)instance.spParam); assertNotNull(instance.sentData); checkSPData(instance.sentData, 55); }