@Test(enabled = false)
public void testSave() throws Exception {
AuthStore authStore = new MemoryAuthStore();
UserAuthenticationDataWrapper authenticationData1 = new UserAuthenticationDataWrapper();
authenticationData1.setData(UserAuthenticationData.USERNAME, "Stefan".toCharArray());
authenticationData1.setData(UserAuthenticationData.PASSWORD, "Password".toCharArray());
authenticationData1.setData(new UserAuthenticationData.Type("path"), "c:\\file".toCharArray());
UserAuthenticationDataWrapper authenticationData2 = new UserAuthenticationDataWrapper();
authenticationData2.setData(UserAuthenticationData.USERNAME, "Stefaan".toCharArray());
authenticationData2.setData(UserAuthenticationData.PASSWORD, "Passwodrd".toCharArray());
authenticationData2.setData(UserAuthenticationData.DOMAIN, "MS".toCharArray());
UserAuthenticationDataWrapper authenticationData3 = new UserAuthenticationDataWrapper();
authenticationData3.setData(UserAuthenticationData.USERNAME, "Stefan".toCharArray());
authenticationData3.setData(UserAuthenticationData.PASSWORD, "Passwo@rd".toCharArray());
authenticationData3.setData(UserAuthenticationData.DOMAIN, "MSzx!X%a".toCharArray());
authStore.add(new UserAuthenticationInfo("ftp", "host1", "stefan"), authenticationData1);
authStore.add(new UserAuthenticationInfo("ftp", "host1", "stefan9"), authenticationData1);
authStore.add(new UserAuthenticationInfo("sftp", "host1a", "astefan"), authenticationData1);
ByteArrayOutputStream bout = new ByteArrayOutputStream();
String expected = IOUtils.toString(this.getClass().getResourceAsStream("credentials.xml"));
expected = expected.replaceAll(">\\s+", ">").replaceAll("\\s+<", "<").replaceAll("<Type>password</Type><Data>.*?<", "<Type>password</Type><Data><").trim();
authStoreUtils.save(authStore, bout);
System.out.println(new String(bout.toByteArray()));
String result = new String(bout.toByteArray()).replaceAll(">\\s+", ">").replaceAll("\\s+<", "<").replaceAll("<Type>password</Type><Data>.*?<", "<Type>password</Type><Data><").trim();
assertEquals(result, expected);
}