@Test public void shouldNotReplaceHtmlTags() { Patient patient = new Patient(); patient.addForeName("rich"); patient.addForeName("richard"); patient.addSurname("Jackson"); patient.addNhsNumber("11122"); PatientAddress patientAddress1 = new PatientAddress(); patientAddress1.setAddress("addressText"); patientAddress1.setPostCode("cb4 2za"); PatientAddress patientAddress2 = new PatientAddress(); patientAddress2.setAddress("addressText"); patientAddress2.setPostCode("cb4 2za"); patient.addAddress(patientAddress1); patient.addAddress(patientAddress2); patient.addPhoneNumber("50090051234"); patient.addPhoneNumber("11090051234"); String anonymisedText = anonymisationService.pseudonymisePersonHTML(patient, "<html>\n" + "<body>\n" + "<rich>Richard RICH Jackson</rich>\n" + "\n" + "Ism MrK\n" + "\n" + "\n" + "</body>\n" + "</html>"); assertTrue(anonymisedText.contains("<rich>")); assertTrue(anonymisedText.contains("XXXXX XXXXX XXXXX")); }
public String pseudonymisePersonHTML(Patient patient, String text) { Document document = Jsoup.parse(text); traverseAndAnonymise(document, patient); return document.toString(); }
AnonymisationService { public String pseudonymisePersonHTML(Patient patient, String text) { Document document = Jsoup.parse(text); traverseAndAnonymise(document, patient); return document.toString(); } }
AnonymisationService { public String pseudonymisePersonHTML(Patient patient, String text) { Document document = Jsoup.parse(text); traverseAndAnonymise(document, patient); return document.toString(); }  }
AnonymisationService { public String pseudonymisePersonHTML(Patient patient, String text) { Document document = Jsoup.parse(text); traverseAndAnonymise(document, patient); return document.toString(); }  String pseudonymisePersonHTML(Patient patient, String text); String pseudonymisePersonPlainText(Patient patient, String text); void setNamePseudonymiser(NamePseudonymiser namePseudonymiser); void setPhonePseudonymiser(PhonePseudonymiser phonePseudonymiser); void setDateOfBirthPseudonymiser(DateOfBirthPseudonymiser dateOfBirthPseudonymiser); void setNhsNumberPseudonymiser(NHSNumberPseudonymiser nhsNumberPseudonymiser); void setAddressPseudonymiser(AddressPseudonymiser addressPseudonymiser); }
AnonymisationService { public String pseudonymisePersonHTML(Patient patient, String text) { Document document = Jsoup.parse(text); traverseAndAnonymise(document, patient); return document.toString(); }  String pseudonymisePersonHTML(Patient patient, String text); String pseudonymisePersonPlainText(Patient patient, String text); void setNamePseudonymiser(NamePseudonymiser namePseudonymiser); void setPhonePseudonymiser(PhonePseudonymiser phonePseudonymiser); void setDateOfBirthPseudonymiser(DateOfBirthPseudonymiser dateOfBirthPseudonymiser); void setNhsNumberPseudonymiser(NHSNumberPseudonymiser nhsNumberPseudonymiser); void setAddressPseudonymiser(AddressPseudonymiser addressPseudonymiser);  }