ProviderNameTaskMigrator implements TaskMigrator { @Override public void migrate(Task task) { migrateActions(task); migrateDataSources(task); migrateFilters(task); }  @Override void migrate(Task task);  }
@Test public void shouldMigrateTasks() { prepareTask(); migrator.migrate(task); assertEquals("{{ad.data-services.MotechPermission#0.name}}", action1Values.get("key-to-change")); assertEquals("{{ad.data-services.MotechPermission#1.name}}", action1Values.get("key-to-leave")); assertEquals("{{ad.cms-lite.StringResource#0.value}}", action2Values.get("key-to-change")); assertEquals("test", action2Values.get("key-to-leave")); verify(filter).setKey("ad.data-services.MotechPermission#0.name"); verify(lookup).setValue("{{ad.data-services.MotechPermission#0.name}}"); }
@Test(expected = ProviderNotFoundException.class) public void shouldThrowExceptionOnNonExistentProvider() { prepareTask(); action1Values.put("invalid", "{{ad.3.something#1.val}}"); migrator.migrate(task); }