void () { final LighthouseRepository repository = new LighthouseRepository(new LighthouseRepositoryType()); // We need to save something different from the defaults apart from transient password/token, // otherwise XmlSerializer.serialize(...) returns null. repository.setUrl("https://test.lighthouseapp.com"); final String apiToken = "secret"; repository.setPassword(apiToken); final Element serialized = XmlSerializer.serialize(repository); final String settingsContent = JDOMUtil.write(serialized); assertFalse(settingsContent.contains(apiToken)); }