void () { final String token = "secret"; myRepository.setPassword(token); final Element serialized = XmlSerializer.serialize(myRepository); final String configContent = JDOMUtil.write(serialized); assertFalse(configContent.contains(token)); }