### Question:
DataMigrationManagerImpl implements DataMigrationManager { @Override public String getLastStatus( final String pluginName ) { Preconditions.checkNotNull( pluginName, "pluginName cannot be null" ); return migrationInfoSerialization.getStatusMessage( pluginName ); } @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();  }### Answer:
@Test public void testLastStatus() { final String name = "plugin1"; final String status = "some status"; final Set<MigrationPlugin> plugins = new LinkedHashSet<>(); MigrationPlugin plugin1 = mock( MigrationPlugin.class ); when( plugin1.getPhase() ).thenReturn( PluginPhase.MIGRATE ); when( plugin1.getName() ).thenReturn( name ); plugins.add( plugin1 ); final MigrationInfoSerialization migrationInfoSerialization = mock( MigrationInfoSerialization.class ); when(migrationInfoSerialization.getStatusMessage( name )).thenReturn( status ); final MigrationInfoCache migrationInfoCache = mock(MigrationInfoCache.class); DataMigrationManagerImpl migrationManager = new DataMigrationManagerImpl( plugins, migrationInfoSerialization, migrationInfoCache ); final String returnedStatus = migrationManager.getLastStatus( name ); assertEquals(status, returnedStatus); }