MongoDbFeatureExecutor extends AbstractDbFeatureExecutor<Document, MongoDatabase> { @Override protected DbFeature<MongoDatabase> createCleanupFeature(final CleanupStrategy cleanupStrategy, final List<Document> initialDataSets) { return (final MongoDatabase connection) -> { final CleanupStrategyExecutor<MongoDatabase, Document> executor = cleanupStrategy.provide(new CleanupStrategyProvider()); executor.execute(connection, initialDataSets); }; } MongoDbFeatureExecutor(final FeatureResolver featureResolver);   }
@SuppressWarnings("unchecked") @Test public void testCleanupFeatureExecution() throws DbFeatureException { when(cleanupStrategy.provide(any(CleanupStrategy.StrategyProvider.class))).thenReturn(cleanupStrategyExecutor); final List<Document> initialDataSets = Arrays.asList(new Document()); final DbFeature<MongoDatabase> feature = featureExecutor.createCleanupFeature(cleanupStrategy, initialDataSets); assertThat(feature, notNullValue()); feature.execute(connection); verify(cleanupStrategyExecutor).execute(eq(connection), eq(initialDataSets)); }