@Test public void testPreProcessData() { String data = "{\"class\":\"sp_portal.local.StandardizedPatient\",\"id\":5,\"anamnesisForm\":{\"class\":\"sp_portal.local.AnamnesisForm\",\"id\":5,\"anamnesisChecksValues\":[{\"class\":\"sp_portal.local.AnamnesisChecksValue\",\"id\":10,\"anamnesisCheck\":{\"class\":\"sp_portal.local.AnamnesisCheck\",\"id\":8,\"origId\":5,\"sortOrder\":6,\"text\":\"Leiden Sie unter Diabetes?\",\"title\":{\"class\":\"sp_portal.local.AnamnesisCheck\",\"id\":2,\"origId\":11,\"sortOrder\":5,\"text\":\"Disease history category\",\"title\":null,\"type\":4,\"userSpecifiedOrder\":null,\"value\":\"\"},\"type\":1,\"userSpecifiedOrder\":null,\"value\":\"\"},\"anamnesisChecksValue\":null,\"anamnesisForm\":{\"_ref\":\"../..\",\"class\":\"sp_portal.local.AnamnesisForm\"},\"comment\":null,\"origId\":15,\"truth\":false},{\"class\":\"sp_portal.local.AnamnesisChecksValue\",\"id\":9,\"anamnesisCheck\":{\"class\":\"sp_portal.local.AnamnesisCheck\",\"id\":4,\"origId\":1,\"sortOrder\":2,\"text\":\"Rauchen Sie?\",\"title\":{\"class\":\"sp_portal.local.AnamnesisCheck\",\"id\":1,\"origId\":10,\"sortOrder\":1,\"text\":\"Personal lifestyle category\",\"title\":null,\"type\":4,\"userSpecifiedOrder\":null,\"value\":\"\"},\"type\":1,\"userSpecifiedOrder\":null,\"value\":\"\"},\"anamnesisChecksValue\":null,\"anamnesisForm\":{\"_ref\":\"../..\",\"class\":\"sp_portal.local.AnamnesisForm\"},\"comment\":null,\"origId\":14,\"truth\":false}],\"createDate\":\"2009-09-18T16:00:00Z\",\"origId\":6,\"scars\":[],\"standardizedPatients\":[{\"_ref\":\"../..\",\"class\":\"sp_portal.local.StandardizedPatient\"}]},\"bankaccount\":{\"class\":\"sp_portal.local.Bankaccount\",\"id\":5,\"bankName\":\"KTS\",\"bic\":\"BENDSFF1JEV\",\"city\":null,\"iban\":\"CH78 5685 7565 4364 7\",\"origId\":31,\"ownerName\":null,\"postalCode\":null,\"standardizedPatients\":[{\"_ref\":\"../..\",\"class\":\"sp_portal.local.StandardizedPatient\"}]},\"birthday\":\"1965-09-23T16:00:00Z\",\"city\":\"Basel\",\"description\":null,\"email\":\"beddebu@hss.ch\",\"gender\":1,\"height\":182,\"immagePath\":null,\"maritalStatus\":null,\"mobile\":\"078 586 29 84\",\"name\":\"Buser\",\"nationality\":{\"class\":\"sp_portal.local.Nationality\",\"id\":2,\"nationality\":\"Deutschland\",\"origId\":6},\"origId\":23,\"postalCode\":4051,\"preName\":\"Bettina\",\"profession\":{\"class\":\"sp_portal.local.Profession\",\"id\":5,\"origId\":6,\"profession\":\"Florist/in\"},\"socialInsuranceNo\":null,\"street\":\"Rankenbergweg 1\",\"telephone\":null,\"telephone2\":null,\"videoPath\":null,\"weight\":82,\"workPermission\":null}"; String expected = "{\"class\":\"ch.unibas.medizin.osce.domain.StandardizedPatient\",\"anamnesisForm\":{\"class\":\"ch.unibas.medizin.osce.domain.AnamnesisForm\",\"anamnesischecksvalues\":[{\"class\":\"ch.unibas.medizin.osce.domain.AnamnesisChecksValue\",\"anamnesischeck\":{\"class\":\"ch.unibas.medizin.osce.domain.AnamnesisCheck\",\"id\":5,\"sortOrder\":6,\"text\":\"Leiden Sie unter Diabetes?\",\"title\":{\"class\":\"ch.unibas.medizin.osce.domain.AnamnesisCheck\",\"id\":11,\"sortOrder\":5,\"text\":\"Disease history category\",\"title\":null,\"type\":4,\"userSpecifiedOrder\":null,\"value\":\"\"},\"type\":1,\"userSpecifiedOrder\":null,\"value\":\"\"},\"anamnesisChecksValue\":null,\"anamnesisForm\":{\"ignoreMe\":\"../..\",\"class\":\"ch.unibas.medizin.osce.domain.AnamnesisForm\"},\"comment\":null,\"id\":15,\"truth\":false},{\"class\":\"ch.unibas.medizin.osce.domain.AnamnesisChecksValue\",\"anamnesischeck\":{\"class\":\"ch.unibas.medizin.osce.domain.AnamnesisCheck\",\"id\":1,\"sortOrder\":2,\"text\":\"Rauchen Sie?\",\"title\":{\"class\":\"ch.unibas.medizin.osce.domain.AnamnesisCheck\",\"id\":10,\"sortOrder\":1,\"text\":\"Personal lifestyle category\",\"title\":null,\"type\":4,\"userSpecifiedOrder\":null,\"value\":\"\"},\"type\":1,\"userSpecifiedOrder\":null,\"value\":\"\"},\"anamnesisChecksValue\":null,\"anamnesisForm\":{\"ignoreMe\":\"../..\",\"class\":\"ch.unibas.medizin.osce.domain.AnamnesisForm\"},\"comment\":null,\"id\":14,\"truth\":false}],\"createDate\":\"2009-09-18T16:00:00Z\",\"id\":6,\"scars\":[],\"standardizedPatients\":[{\"ignoreMe\":\"../..\",\"class\":\"ch.unibas.medizin.osce.domain.StandardizedPatient\"}]},\"bankAccount\":{\"class\":\"ch.unibas.medizin.osce.domain.Bankaccount\",\"bankName\":\"KTS\",\"BIC\":\"BENDSFF1JEV\",\"city\":null,\"IBAN\":\"CH78 5685 7565 4364 7\",\"id\":31,\"ownerName\":null,\"postalCode\":null,\"standardizedPatients\":[{\"ignoreMe\":\"../..\",\"class\":\"ch.unibas.medizin.osce.domain.StandardizedPatient\"}]},\"birthday\":\"1965-09-23T16:00:00Z\",\"city\":\"Basel\",\"description\":null,\"email\":\"beddebu@hss.ch\",\"gender\":1,\"height\":182,\"immagePath\":null,\"maritalStatus\":null,\"mobile\":\"078 586 29 84\",\"name\":\"Buser\",\"nationality\":{\"class\":\"ch.unibas.medizin.osce.domain.Nationality\",\"nationality\":\"Deutschland\",\"id\":6},\"id\":23,\"postalCode\":4051,\"preName\":\"Bettina\",\"profession\":{\"class\":\"ch.unibas.medizin.osce.domain.Profession\",\"id\":6,\"profession\":\"Florist/in\"},\"socialInsuranceNo\":null,\"street\":\"Rankenbergweg 1\",\"telephone\":null,\"telephone2\":null,\"videoPath\":null,\"weight\":82,\"workPermission\":null}"; String ret = instance.preProcessData(data); assertEquals("preProcessData ",expected,ret); }
public String preProcessData(String data) { data = data.replaceAll("\"id\":[0-9]*,", ""); data = data.replaceAll("origId", "id"); data = data.replaceAll("bankaccount", "bankAccount"); data = data.replaceAll("sp_portal\\.local","ch.unibas.medizin.osce.domain"); data = data.replaceAll("anamnesisChecksValues","anamnesischecksvalues"); data = data.replaceAll("\"anamnesisCheck\"","\"anamnesischeck\""); data = data.replaceAll("\"_ref\"","\"ignoreMe\""); data = data.replaceAll("\"iban\"","\"IBAN\""); data = data.replaceAll("\"bic\"","\"BIC\""); return data; }
DMZSyncServiceImpl extends RemoteServiceServlet implements
		DMZSyncService { public String preProcessData(String data) { data = data.replaceAll("\"id\":[0-9]*,", ""); data = data.replaceAll("origId", "id"); data = data.replaceAll("bankaccount", "bankAccount"); data = data.replaceAll("sp_portal\\.local","ch.unibas.medizin.osce.domain"); data = data.replaceAll("anamnesisChecksValues","anamnesischecksvalues"); data = data.replaceAll("\"anamnesisCheck\"","\"anamnesischeck\""); data = data.replaceAll("\"_ref\"","\"ignoreMe\""); data = data.replaceAll("\"iban\"","\"IBAN\""); data = data.replaceAll("\"bic\"","\"BIC\""); return data; } }
DMZSyncServiceImpl extends RemoteServiceServlet implements
		DMZSyncService { public String preProcessData(String data) { data = data.replaceAll("\"id\":[0-9]*,", ""); data = data.replaceAll("origId", "id"); data = data.replaceAll("bankaccount", "bankAccount"); data = data.replaceAll("sp_portal\\.local","ch.unibas.medizin.osce.domain"); data = data.replaceAll("anamnesisChecksValues","anamnesischecksvalues"); data = data.replaceAll("\"anamnesisCheck\"","\"anamnesischeck\""); data = data.replaceAll("\"_ref\"","\"ignoreMe\""); data = data.replaceAll("\"iban\"","\"IBAN\""); data = data.replaceAll("\"bic\"","\"BIC\""); return data; }  }
DMZSyncServiceImpl extends RemoteServiceServlet implements
		DMZSyncService { public String preProcessData(String data) { data = data.replaceAll("\"id\":[0-9]*,", ""); data = data.replaceAll("origId", "id"); data = data.replaceAll("bankaccount", "bankAccount"); data = data.replaceAll("sp_portal\\.local","ch.unibas.medizin.osce.domain"); data = data.replaceAll("anamnesisChecksValues","anamnesischecksvalues"); data = data.replaceAll("\"anamnesisCheck\"","\"anamnesischeck\""); data = data.replaceAll("\"_ref\"","\"ignoreMe\""); data = data.replaceAll("\"iban\"","\"IBAN\""); data = data.replaceAll("\"bic\"","\"BIC\""); return data; }  @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); }
DMZSyncServiceImpl extends RemoteServiceServlet implements
		DMZSyncService { public String preProcessData(String data) { data = data.replaceAll("\"id\":[0-9]*,", ""); data = data.replaceAll("origId", "id"); data = data.replaceAll("bankaccount", "bankAccount"); data = data.replaceAll("sp_portal\\.local","ch.unibas.medizin.osce.domain"); data = data.replaceAll("anamnesisChecksValues","anamnesischecksvalues"); data = data.replaceAll("\"anamnesisCheck\"","\"anamnesischeck\""); data = data.replaceAll("\"_ref\"","\"ignoreMe\""); data = data.replaceAll("\"iban\"","\"IBAN\""); data = data.replaceAll("\"bic\"","\"BIC\""); return data; }  @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);  }