@Test public void test2PluginsNameOrder() throws MigrationException { final Set<MigrationPlugin> plugins = new HashSet<>(); MigrationPlugin plugin1 = mock( MigrationPlugin.class ); when( plugin1.getPhase() ).thenReturn( PluginPhase.MIGRATE ); when( plugin1.getName() ).thenReturn( "plugin2" ); MigrationPlugin plugin2 = mock( MigrationPlugin.class ); when( plugin2.getPhase() ).thenReturn( PluginPhase.MIGRATE ); when( plugin2.getName() ).thenReturn( "plugin1" ); plugins.add( plugin1 ); plugins.add( plugin2 ); final MigrationInfoSerialization migrationInfoSerialization = mock( MigrationInfoSerialization.class ); final MigrationInfoCache migrationInfoCache = mock(MigrationInfoCache.class); DataMigrationManagerImpl migrationManager = new DataMigrationManagerImpl( plugins, migrationInfoSerialization, migrationInfoCache ); assertTrue(migrationManager.getExecutionOrder().get(0).getName() == "plugin1"); assertTrue(migrationManager.getExecutionOrder().get(1).getName() == "plugin2"); }
public List<MigrationPlugin> getExecutionOrder(){return executionOrder;}
DataMigrationManagerImpl implements DataMigrationManager { public List<MigrationPlugin> getExecutionOrder(){return executionOrder;} }
DataMigrationManagerImpl implements DataMigrationManager { public List<MigrationPlugin> getExecutionOrder(){return executionOrder;} @Inject  DataMigrationManagerImpl( final Set<MigrationPlugin> plugins,
                                     final MigrationInfoSerialization migrationInfoSerialization,
                                     final MigrationInfoCache migrationInfoCache
    ); }
DataMigrationManagerImpl implements DataMigrationManager { public List<MigrationPlugin> getExecutionOrder(){return executionOrder;} @Inject  DataMigrationManagerImpl( final Set<MigrationPlugin> plugins,
                                     final MigrationInfoSerialization migrationInfoSerialization,
                                     final MigrationInfoCache migrationInfoCache
    ); @Override boolean pluginExists(final String name); @Override void migrate(final String name); @Override void migrate(); @Override boolean isRunning(); @Override int getCurrentVersion( final String pluginName ); @Override void resetToVersion( final String pluginName, final int version ); @Override String getLastStatus( final String pluginName ); @Override Set<String> getPluginNames(); List<MigrationPlugin> getExecutionOrder(); }
DataMigrationManagerImpl implements DataMigrationManager { public List<MigrationPlugin> getExecutionOrder(){return executionOrder;} @Inject  DataMigrationManagerImpl( final Set<MigrationPlugin> plugins,
                                     final MigrationInfoSerialization migrationInfoSerialization,
                                     final MigrationInfoCache migrationInfoCache
    ); @Override boolean pluginExists(final String name); @Override void migrate(final String name); @Override void migrate(); @Override boolean isRunning(); @Override int getCurrentVersion( final String pluginName ); @Override void resetToVersion( final String pluginName, final int version ); @Override String getLastStatus( final String pluginName ); @Override Set<String> getPluginNames(); List<MigrationPlugin> getExecutionOrder();  }