try {
RiverName riverName = new RiverName("mongodb", "mongodb-" + System.currentTimeMillis());
InputStream in = getClass().getResourceAsStream("/org/elasticsearch/river/mongodb/test-mongodb-river-definition-store-statistics.json");
RiverSettings riverSettings = new RiverSettings(ImmutableSettings.settingsBuilder().build(), XContentHelper.convertToMap(
Streams.copyToByteArray(in), false).v2());
ScriptService scriptService = null;
MongoDBRiverDefinition definition = MongoDBRiverDefinition.parseSettings(riverName.name(),
RiverIndexName.Conf.DEFAULT_INDEX_NAME, riverSettings, scriptService);
Assert.assertNotNull(definition);
Assert.assertTrue(definition.isStoreStatistics());
Assert.assertEquals(definition.getStatisticsIndexName(), "archive-stats");