use of com.zimbra.cs.ephemeral.migrate.AttributeMigration.MigrationTask in project zm-mailbox by Zimbra.
the class MigrateAttributesTest method testCsrfTokenMigrationTask.
/*
* Test MigrationTask for CSRF tokens
*/
@Test
public void testCsrfTokenMigrationTask() throws ServiceException {
List<EphemeralInput> results = new LinkedList<EphemeralInput>();
Map<String, AttributeConverter> converters = new HashMap<String, AttributeConverter>();
converters.put(Provisioning.A_zimbraCsrfTokenData, new CsrfTokenConverter());
MigrationTask task = new MigrationTask(acct, converters, new DummyMigrationCallback(results));
task.migrateAttributes();
assertEquals(2, results.size());
verifyCsrfTokenEphemeralInput(results.get(0), "crumb1", "data1", 100000L);
verifyCsrfTokenEphemeralInput(results.get(1), "crumb2", "data2", 100000L);
}
use of com.zimbra.cs.ephemeral.migrate.AttributeMigration.MigrationTask in project zm-mailbox by Zimbra.
the class MigrateAttributesTest method testAuthTokenMigrationTask.
/*
* Test MigrationTask for auth tokens
*/
@Test
public void testAuthTokenMigrationTask() throws ServiceException {
List<EphemeralInput> results = new LinkedList<EphemeralInput>();
Map<String, AttributeConverter> converters = new HashMap<String, AttributeConverter>();
converters.put(Provisioning.A_zimbraAuthTokens, new AuthTokenConverter());
MigrationTask task = new MigrationTask(acct, converters, new DummyMigrationCallback(results));
task.migrateAttributes();
assertEquals(2, results.size());
verifyAuthTokenEphemeralInput(results.get(0), "1234", "server_1", 100000L);
verifyAuthTokenEphemeralInput(results.get(1), "5678", "server_2", 100000L);
}
use of com.zimbra.cs.ephemeral.migrate.AttributeMigration.MigrationTask in project zm-mailbox by Zimbra.
the class MigrateAttributesTest method testLastLogonTimestampMigrationTask.
/*
* Test MigrationTask for last login timestamp
*/
@Test
public void testLastLogonTimestampMigrationTask() throws ServiceException {
List<EphemeralInput> results = new LinkedList<EphemeralInput>();
Map<String, AttributeConverter> converters = new HashMap<String, AttributeConverter>();
converters.put(Provisioning.A_zimbraLastLogonTimestamp, new StringAttributeConverter());
MigrationTask task = new MigrationTask(acct, converters, new DummyMigrationCallback(results));
task.migrateAttributes();
assertEquals(1, results.size());
verifyLastLogonTimestampEphemeralInput(results.get(0), "currentdate");
}
Aggregations